Skip to content

Instantly share code, notes, and snippets.

@erudenko
Created July 21, 2022 10:22
Show Gist options
  • Save erudenko/b9b01af777ac17b27173197c887482ec to your computer and use it in GitHub Desktop.
Save erudenko/b9b01af777ac17b27173197c887482ec to your computer and use it in GitHub Desktop.
Adnroid interview
const val text1 = "I love big red ballon"
const val expected1 = "I evol gib der nollab"
const val text2 = "I love big red ballon!"
const val expected2 = "I evol gib der nollab!"
fun main() {
val rev1 = reversed(text1)
if (expected1 != rev1) {
System.err.println("The test 1 failed, got: $rev1\nexpected:$expected1\n")
} else {
println("Test 1 passed!")
}
val rev2 = reversed(text2)
if (expected2 != rev2) {
System.err.println("The test 2 failed, got:$rev2\nexpected:$expected2\n")
} else {
println("Test 2 passed!")
}
}
fun reversed(s: String): String {
return s
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment