Modify the program below so that it outputs true or false depending on whether the input string is a palindrome or not.
Strings
Palindrome
Report a typo
Sample Input 1:
A man, a plan, a canal – PanamaSample Output 1:
trueWrite a program in Scala 3
object PalindromeChecker extends App {
val input = scala.io.StdIn.readLine()
val onlyLoweredLetters = input.filter(_.isLetter).???
println(onlyLoweredLetters == ???)
}
___
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.