In an OpenAI chat surface, some validation checks may need to determine whether a user-provided string reads the same forward and backward. Write a function that returns True if a string is a palindrome and False otherwise.
A palindrome is a string that is identical when reversed. For this problem, compare characters exactly as given: do not ignore spaces, punctuation, or letter casing.
ss is a palindromeExample 1
s = "racecar"TrueExample 2
s = "openai"FalseExample 3
s = "Aa"False"A" != "a".0 <= len(s) <= 10^5s contains printable ASCII charactersA solution with two pointers is expected and should run in linear time.