Home
Log in
DescriptionSubmissionsSolution
DescriptionSubmissionsSolution
Loading...

Log in to run or submit

s =

Codey

Practise coding problems, test your solutions and track your progress.

Explore

  • Problems
  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

© 2026 Codey. Personal learning project.

Solution
Updated: 2026-02-23

Idea

Use two pointers from both ends, skipping non-alphanumeric characters and comparing case-insensitively.

Approach

Move l and r inward while they point to non-alphanumeric characters. Compare lower() of the remaining characters.

Why it works

A palindrome reads the same forwards/backwards once punctuation and case differences are ignored.

Code
Loading...
Complexity
Time: O(n)
Space: O(1)
Solution
Updated: 2026-02-23

Idea

Use two pointers from both ends, skipping non-alphanumeric characters and comparing case-insensitively.

Approach

Move l and r inward while they point to non-alphanumeric characters. Compare lower() of the remaining characters.

Why it works

A palindrome reads the same forwards/backwards once punctuation and case differences are ignored.

Code
Loading...
Complexity
Time: O(n)
Space: O(1)