#always think 'divide and conquer', 'decrease and conquer'

def isPalindrome(string):
    def toChar(string):
        ans = ''
        string = string.lower()
        for c in string:
            if c in 'abcdefghijklmnopqrstuvwxyz':
                ans += c
        return ans
    
    def isPal(string):
        if len(string) <= 1:
            return True
        else:
            return string[0] == string[-1] and isPal(string[1: -1])
    
    return isPal(toChar(string))

print(isPalindrome('hi'))
92ea1f966712dc8efc02e408f8a7503dd9f3bd5b
<mask token>

def isPalindrome(string):

    def toChar(string):
        ans = ''
        string = string.lower()
        for c in string:
            if c in 'abcdefghijklmnopqrstuvwxyz':
                ans += c
        return ans

    def isPal(string):
        if len(string) <= 1:
            return True
        else:
            return string[0] == string[-1] and isPal(string[1:-1])
    return isPal(toChar(string))


<mask token>

def isPalindrome(string):

    def toChar(string):
        ans = ''
        string = string.lower()
        for c in string:
            if c in 'abcdefghijklmnopqrstuvwxyz':
                ans += c
        return ans

    def isPal(string):
        if len(string) <= 1:
            return True
        else:
            return string[0] == string[-1] and isPal(string[1:-1])
    return isPal(toChar(string))


print(isPalindrome('hi'))

#always think 'divide and conquer', 'decrease and conquer'

def isPalindrome(string):
    def toChar(string):
        ans = ''
        string = string.lower()
        for c in string:
            if c in 'abcdefghijklmnopqrstuvwxyz':
                ans += c
        return ans
    
    def isPal(string):
        if len(string) <= 1:
            return True
        else:
            return string[0] == string[-1] and isPal(string[1: -1])
    
    return isPal(toChar(string))

print(isPalindrome('hi'))