Python interview question: valid palindrome

EasyTwo pointers

Problem

For anniversary “mirror” promo codes, return True if code reads the same in both directions, ignoring case and every character that isn’t a letter or a digit. Letters aren’t only A–Z: ñ and é count too. An empty code counts as a mirror.

def is_mirror_code(code: str) -> bool:

Example

Solve it free

Checked against hidden tests, right in your browser. No sign-up needed.

Skills it tests

More interview questions

All questions