Palindrome

Report a typo

Modify the program below so that it outputs true or false depending on whether the input string is a palindrome or not.

Sample Input 1:

A man, a plan, a canal – Panama

Sample Output 1:

true
Write a program in Scala 3
object PalindromeChecker extends App {
val input = scala.io.StdIn.readLine()
val onlyLoweredLetters = input.filter(_.isLetter).???
println(onlyLoweredLetters == ???)
}
___

Create a free account to access the full topic