1. Excel Sheet Column Number
1
2
3
4
5
6
7
public int titleToNumber(String s) {
int res = 0;
for (int i = 0; i < s.length(); ++i) {
res = res*26 + (s.charAt(i) - 'A' + 1);
}
return res;
}

注意 res = 26 * res + (xxx)迭代res对应的s的顺序, 正反不要弄反了