Check if string is palindrome or not

Beginner Problems Basic Recursion Easy

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.

Examples:

Input : s = "hannah"

Output : true

Explanation : The string when reversed is --> "hannah", which is same as original string , so we return true.

Input : s = "aabbaaa"

Output : false

Explanation : The string when reversed is --> "aaabbaa", which is not same as original string, So we return false.

Input : s = "aabbcccdbbaa"

Constraints

  • 1 <= s.length <= 103
  • s consist of only uppercase and lowercase English characters.

Company Tags

TCS Cognizant Accenture Infosys Capgemini Wipro IBM HCL Tech Mahindra MindTree