278. Check if String is Palindrome or Not
Given a string s, return true if the string is palindrome, otherwise false.
A string is called palindrome if it reads the same forward and backward.
Example 1:
Input : s = "hannah"
Output : true
Explanation : The string when reversed is --> "hannah", which is same as original string , so we return true.
Example 2:
Input : s = "aabbaA"
Output : false
Explanation : The string when reversed is --> "Aabbaa", which is not same as original string, So we return false.
Now Your Turn!
Pick the correct output for the given inputInput : s = "aabbcccdbbaa"
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= s.length <= 103
- s consist of only uppercase and lowercase English characters.