My 40ms 3 line python code, easy to understand

  • 0
    class Solution(object):
        def isStrobogrammatic(self, num):
            L = ['0', '1', None, None, None, None, '9', None, '8', '6']
            num2 = map(lambda x : L[int(x)], list(num))
            return False if None in num2 else num2[::-1] == list(num)

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.