In & General Intuition's mobile surfaces, lightweight input validation may need to detect whether a text string reads the same forward and backward. Write a function that returns whether a given string is a palindrome.
A palindrome is a string that is identical when reversed. For this problem, compare characters exactly as they appear: case, spaces, punctuation, and digits all matter.
sTrue if s is a palindromeFalse otherwiseExample 1
Input: s = "racecar"
Output: True
"racecar" reads the same from left to right and right to left.
Example 2
Input: s = "hello"
Output: False
The reversed string is "olleh", which does not match the original.
Example 3
Input: s = "a b a"
Output: True
Spaces are part of the string, and this exact sequence is symmetric.
0 <= len(s) <= 10^5s may contain lowercase letters, uppercase letters, digits, spaces, and punctuation