Back

Palindrome

Description

Fix the incorrect code to pass all the test cases.

Given a string s, return true if it is a palindrome, otherwise return false. A palindrome is a string that reads the same forward and backward. It is also case-insensitive and ignores all non-alphanumeric characters. Note: Alphanumeric characters consist of letters (A-Z, a-z) and numbers (0-9).

  1. s = A man, a plan, a canal: Panama

    expected = True

  2. s = race a car

    expected = False

  3. s =

    expected = True

  4. s = 0P

    expected = False

  5. s = abba

    expected = True

  6. s = abcba

    expected = True

  7. s = No 'x' in Nixon

    expected = True

  8. s = .,,

    expected = True

  9. s = a.

    expected = True

  10. s = Àbbà

    expected = False

  11. s = åböbå

    expected = True

  12. s = 123321

    expected = True

  13. s = 123421

    expected = False

  14. s = Able was I ere I saw Elba

    expected = True