Skip to content

Palindrome check

Palindrome check

A palindrome reads the same forwards and backwards. Return true if s does, ignoring case and spaces, so Race car counts. Clean the string first (toLowerCase, remove spaces), then compare characters moving inward from both ends.

Log in or create account

IGCSE & A-Level