LC171.Excel Sheet Column Number Author: LEI XIA Date: 二月 21, 2020 9:15 Excel Sheet Column Number 1234567public 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的顺序, 正反不要弄反了 Tag(s): back · home LC54. Spiral Matrix LC168. Excel Sheet Column Title