We have a list of words, and we must obtain a list of palindromes. Remember: a palindrome is a word or other sequence of characters that reads the same backward as forward (we don't care about the letter case in this exercise). Using a filtering function, obtain the list of palindromes.
Filtering elements in collection
A palindrome list
Report a typo
Sample Input 1:
kayak deified rotator test repaperSample Output 1:
[kayak, deified, rotator, repaper]Write a program in Kotlin
/* Do not change code below */
fun main() {
val list = readln().split(" ")
// write your code here
val res =
println(res)
}
___
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.