Using Math.pow()


#1

Comment body goes herpublic class Solution {
public int titleToNumber(String A) {

    int res = 0;
    int len = A.length();
    for(int i=0;i<len;i++){
        
        res += ((A.charAt(i)-'A'+1)*Math.pow(26,len-1));
        len--;
        
    }

    return res;
}

}
e.