Check Palindrome
Medium
strings
Description
Determine if a given string is a palindrome (reads the same forwards and backwards, ignoring case and non-alphanumeric characters).
Examples
Example1:
Input: 'A man a plan a canal Panama'
Output: true
Explanation: After cleaning and lowercasing, the string is 'amanaplanacanalpanama', which is a palindrome.
Example2:
Input: 'hello'
Output: false
Constraints
- Must ignore case.
- Must ignore spaces and punctuation/symbols.
Loading...
Test Case 1
Input: "A man a plan a canal Panama"
Output: true
Test Case 2
Input: "madam"
Output: true
Test Case 3
Input: "race car"
Output: true
Test Case 4
Input: "not a palindrome"
Output: false
