Easy 2-line solution


#1
    int answer = 0;
    for(int i = A.size() - 1; i>=0; i--)
        answer += pow(26, A.size() - 1 - i)*(A[i] - 'A' + 1);
    return answer;