String palindrome

1. Plindrome check (Case sensitive)

Project Ref: string-algo-palindrome

Note: For such String problems, analyze the problem as a array of characters and not as a String.

Approach

Approach 1. Two-Pointer Technique:

  1. Initialize two pointers:
  2. Compare the characters at both pointers. - If they don’t match, the string is not a palindrome.
  3. Move the pointers inward: - Increment left. - Decrement right.
  4. Repeat until the pointers cross.

Approach 2: Reverse and Compare

Approach 3: Ignoring Case, Spaces, and Special Characters


------ End ------