class Solution {
public:
int titleToNumber(string s) {
int res = 0;
for (int i=0; i<s.length(); i++) {
res = res * 26 + (s[i] - 'A' + 1);
}
return res;
}
};
Excel Sheet Column Number
Copyright © 2017 Powered by LZH, Theme used GitHub CSS.