C easy 3ms


  • 0
    C

    int titleToNumber(char* s) {
    int r=0;
    int i=0;
    while(s[i])
    {
    r=r*26+s[i]-'A'+1;
    ++i;
    }
    return r;
    }


Log in to reply
 

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