0 ms C solution using pointer operation


  • 0
    int titleToNumber(char* s) {
        int num = 0;
        while(*s)
            num = 26 * num + *s++ - 'A' + 1;
        return num;
    }
    

Log in to reply
 

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