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.
Stack
Palindrome test
Report a typo
Sample Input 1:
referSample Output 1:
trueWrite a program in Kotlin
import java.util.*
fun checkPalindrome(word: String): Boolean {
// write your code here
}
fun main() {
val input = readln()
println(checkPalindrome(input))
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.