#=================================== # Tanzila Islam # Email: tanzilamohita@gmail.com # Language: Python 3 #=================================== class Solution: def isPalindrome(self, s: str) -> bool: mod_string = "" for elem in s: if elem.isalnum(): mod_string += elem if mod_string.lower() == mod_string.lower()[::-1]: return 1 else: return 0
No comments:
Post a Comment