public class Solution {
    public int titleToNumber(String s) {
        int base = (int)'A' - 1;
        int result = 0;
        int base26 = 1;
        for (int i = s.length() - 1; i >= 0; i--) {
            result = ((int)s.charAt(i) - base) * base26 + result;
            base26 = base26 * 26;
        }
        
        return result;
    }
}

@@ -62,41 +62,8 @@
 ) %7B%0A
-        int base = (int)'A' - 1;%0A
     
@@ -94,20 +94,21 @@
     int 
-base
+power
 26 = 1;%0A
@@ -175,87 +175,109 @@
     
-result = ((int)s.charAt(i) - base) * base26 + result;%0A            base26 = base
+int digit = s.charAt(i) - 'A' + 1;%0A            result += digit * power26;%0A            power26 = power
 26 *

Update ExcelSheetColumnNumber.java