Simplest C++ Solution with minimum line of code


#1
     int Solution::titleToNumber(string A) {
           int n=A.size();
           long long ans=0;
                  for(int i=0;i<n;i++){
                           ans=ans+(int(A[i])-64)*pow(26,n-1-i);
                    }
             return ans;

}