Locked

Pass the Dictionary check first

Everything after it builds on dictionaries. Each rep in the check has to be passed without opening the solution. Hints and Basics are fine.

Still to clear · 8 of 8

Continue the check

Preview · where this ladder is heading

Valid Palindrome

s is a phrase. Only its letters and digits count. Upper and lower case are treated the same. Spaces, punctuation and symbols are ignored completely. Return True if the remaining characters read the same from both ends, otherwise False.

Aim for O(1) extra space. Walk two indexes over the original string instead of building a cleaned copy.

is_palindrome("race a car") → False ("raceacar" backwards is "racaecar") is_palindrome(" ") → True (nothing is left to compare)

ins = "Was it a car or a cat I saw?"outTrue
ins = "race a car"outFalse
ins = " "outTrue

You can read it now. The editor opens when the check is cleared.