C solution of this problem


  • 0
    W

    int titleToNumber(char *s) {
    int res = 0;
    for (int i = 0; i < strlen(s); i++){
    res = res * 26 + (s[i] - 'A' + 1);
    }
    return res;
    }


Log in to reply
 

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