Exercise · Strings · lesson 8 of 8
Exercise: palindrome
Write a function func isPalindrome(s string) bool that returns true if the string reads the same from left to right and from right to left. Letter case and spaces do not count.
isPalindrome("Level")→trueisPalindrome("hello")→falseisPalindrome("А роза упала на лапу Азора")→true
Constraints: the string consists of Latin and Russian letters and spaces, with at least one letter; spaces may come at the start, at the end and several in a row.
Do not add extra imports unless the task says so explicitly.
Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.