"""
Exercise 2: edge cases first

Implement is_palindrome(s): True if s reads the same forwards and backwards
after removing every non-alphanumeric character and ignoring case.
Use two pointers (no reversed copy).

List the edge cases you will test in the comment first. The self-check
includes: "", "a", ".,", "A man, a plan, a canal: Panama", "race a car", "0P".
"""

# Edge cases I will test: TODO

def is_palindrome(s):
    # TODO: two pointers from both ends, skipping non-alphanumerics
    return False


# --- self-check: do not modify below this line ---
cases = [("", True), ("a", True), (".,", True), ("A man, a plan, a canal: Panama", True),
         ("race a car", False), ("0P", False), ("ab_a", True)]
ok = True
for s, want in cases:
    got = is_palindrome(s)
    print(repr(s), "->", got, "expected", want)
    ok = ok and got == want
print("PASS" if ok else "FAIL")
