Ad
  • Custom User Avatar

    Top one is actually quite good. If it were for real, I would write it as a proper named function. That way is real nice for avoiding duplication, and something I didn't think of.

    def is_palindrome(s: str):
        processed_text = ''.join(c for c in s.upper() is c.isalpha())
        return (lambda x: x == x[::-1])(processed_text)
    
  • Custom User Avatar

    100% cursed. Love it.

  • Custom User Avatar

    24 characters shorter, and I respected proper formatting rules (still a joke solution though).

  • Custom User Avatar

    nice!

  • Custom User Avatar

    This works. Better to save the computation to a variable so you don't have to perform it twice. You can do this without regular expressions as well, which (in this simple case) is probably better.

  • Custom User Avatar

    tbh it looks mid