Where is the palindrome?

Report a typo

Write a function that takes a CharSequence as input and returns a boolean value indicating whether the input is a palindrome.

A palindrome is a word or phrase that reads the same backward as forward. For example, "racecar" is a palindrome.

Sample Input 1:

racecar

Sample Output 1:

true

Sample Input 2:

sky

Sample Output 2:

false
Write a program in Kotlin
fun isPalindrome(str: CharSequence): Boolean {
// write your code here
}
___

Create a free account to access the full topic