Check If The String Is A Palindrome
String 'S' is NOT case sensitive.
Let S = “c1 O$d@eeD o1c”. If we ignore the special characters, whitespaces and convert all uppercase letters to lowercase, we get S = “c1odeedo1c”, which is a palindrome. Hence, the given string is also a palindrome.
The very first line of input contains an integer 'T' denoting the number of test cases. The first line of every test case contains the string 'S'.
For each test case, print “Yes” if 'S' is a palindrome, and “No” otherwise. Print the output of each test case in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
Can you solve the problem using O(1) space complexity?
1 <= T <= 100 1 <= Length(S) <= 10^4 Where 'T' denotes the number of test cases and 'S' denotes the given string. Time Limit : 1 sec
Ninja and Numbers
Longest Palindromic Substring