Shawngbk / Leecode

Questions of Leecode
0 stars 0 forks source link

171. Excel Sheet Column Number #57

Open Shawngbk opened 7 years ago

Shawngbk commented 7 years ago

参考168

public class Solution { public int titleToNumber(String s) { int res = 0; int len = s.length(); for(int i = 0; i < len; i++) { res = (s.charAt(i)-'A') + 1 + res*26; } return res; } }

Shawngbk commented 7 years ago

uber microsoft