Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 19aaa10

Browse filesBrowse files
author
night
committed
decrypt word
1 parent 4d82f81 commit 19aaa10
Copy full SHA for 19aaa10

File tree

1 file changed

+22
-0
lines changed
Filter options

1 file changed

+22
-0
lines changed
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.blankj.pramp
2+
3+
class Decrypt {
4+
5+
fun decrypt(word: String): String {
6+
val s = StringBuilder()
7+
var oldValue = 1
8+
var newValue: Int
9+
val a = 'a'.code
10+
11+
for (i in word.indices) {
12+
newValue = word[i].code - oldValue
13+
oldValue = word[i].code
14+
15+
while (newValue < a) {
16+
newValue += 26
17+
}
18+
s.append(newValue.toChar())
19+
}
20+
return s.toString()
21+
}
22+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.