Very easy C++ solution


  • 0
    X

    '''
    class Solution {
    public:
    int titleToNumber(string s) {
    int a;
    int n = s.size();
    for(int i = 0;i<n;++i)
    {
    a = a*26 + int(s[i]) - 64;
    }
    return a;
    }
    };
    '''


Log in to reply
 

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