PROBLEMS|MOD 06|EASY

Check if string is a palindrome ignoring spaces

Strings & String Manipulation

Given a string `s`, return `True` if it is a palindrome, `False` otherwise.

// EXAMPLES

Example 1:
Input: Input: racecar
Output: True
Explanation: Result for example 1 of Check if string is a palindrome ignoring spaces.
Example 2:
Input: Input: hello
Output: False
Explanation: Result for example 2 of Check if string is a palindrome ignoring spaces.

// CONSTRAINTS

  • 1 <= len(input) <= 10^5
  • Time Complexity target: O(N) or O(N log N)
  • Space Complexity target: O(1) or O(N)
  • Evaluated against 100 test cases.
solution.py