Skip to content

Commit

Permalink
add kotlin/henckellbach
Browse files Browse the repository at this point in the history
  • Loading branch information
henckellbach authored and narze committed Oct 9, 2021
1 parent 9e5b61d commit 06830a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Kotlin/Henckellbach.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fun coffeeToCode(): String {
val text = "Coffee"

return text
.toCharArray()
.distinct()
.map { it.code }
.map { Char(if (it == 102) it - 2 else it) }
.joinToString("")
}

fun main() {
println(coffeeToCode())
}

0 comments on commit 06830a6

Please sign in to comment.