My python solution using recursion


  • 0
    C
    def titleToNumber(self, s):
        """
        :type s: str
        :rtype: int
        """
            
        return self.titleToNumber(s[:-1]) * 26 + ord(s[-1]) - 64 if s else 0

Log in to reply
 

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