Is it a palindrome?

Report a typo

Look at the code below: the program for determining whether the word passed through the arguments is a palindrome is almost ready. Your task is to complete the code for the program to work correctly.

Write a program in Kotlin
import kotlinx.cli.*

fun checkWords(args: Array<String>){
// make your code here
if (text == text.reversed()) {
println("$text is a palindrome")
} else {
println("$text is not a palindrome")
}
}
___

Create a free account to access the full topic