Palindrome test

Report a typo

A palindrome is a word or group of words that remains the same whether you read it forwards from the beginning or backwards from the end: "refer" and "level" are palindromes. Using the LIFO strategy, write a function that returns true if a word is a palindrome or false if not.

Sample Input 1:

refer

Sample Output 1:

true
Write a program in Kotlin
import java.util.*

fun checkPalindrome(word: String): Boolean {
// write your code here
}

fun main() {
val input = readln()

println(checkPalindrome(input))

}
___

Create a free account to access the full topic