One line cpp code 6ms


  • 0
    S
    int titleToNumber(string s) {
        return s == "" ? 0 : 26*titleToNumber(s.substr(0,s.size()-1)) + s[s.size()-1] - 'A' + 1;
    }

Log in to reply
 

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