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.

This task uses dependencies that may not be available in your local IDE. As a result, you may see compilation errors or unresolved references when running the code locally. This does not affect solution validation when you submit your solution to Hyperskill.

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