share my one-line python solution


  • 0
    J
    def titleToNumber(self, s):
            """
            :type s: str
            :rtype: int
            """
            return reduce(lambda x, y: x * 26 + y, map(lambda c: ord(c) - ord('A') + 1, s))

Log in to reply
 

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