Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding column number.

For example:

A -&gt; 1
B -&gt; 2
C -&gt; 3
...
Z -&gt; 26
AA -&gt; 27
AB -&gt; 28 
...


&nbsp;
Example 1:

Input: columnTitle = "A"
Output: 1


Example 2:

Input: columnTitle = "AB"
Output: 28


Example 3:

Input: columnTitle = "ZY"
Output: 701


&nbsp;
Constraints:


	1 &lt;= columnTitle.length &lt;= 7
	columnTitle consists only of uppercase English letters.
	columnTitle is in the range ["A", "FXSHRXW"].


def let_to_num(char):
    abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    return abc.index(char) + 1

class Solution:
    def titleToNumber(self, columnTitle: str) -> int:
        ans = 0
        for i in range(len(columnTitle)):
            ans *= 26
            ans += let_to_num(columnTitle[i])
        return ans
class Solution {
    public int titleToNumber(String columnTitle) {
        int n = columnTitle.length();
        int pow = 0;
        int res = 0;
        for(int i = n-1; i >= 0; i--) {
            char c = columnTitle.charAt(i);
            res += (c - 64) * Math.pow(26, pow);
            pow++;
        }

        return res;
    }
}
							// 😉😉😉😉Please upvote if it helps 😉😉😉😉
class Solution {
public:
    int titleToNumber(string columnTitle) {
        int result = 0;
        for(char c : columnTitle)
        {
			//d = s[i](char) - 'A' + 1 (we used  s[i] -  'A' to convert the letter to a number like it's going to be C)

            int d = c - 'A' + 1;
            result = result * 26 + d;
        }
        return result;
    }
};
/**
 * @param {string} columnTitle
 * @return {number}
 */
var titleToNumber = function(columnTitle) {
    /*
        one letter: result between 1-26.
        two letter: result between 26^1 + 1 -> 26^2 + digit. 27 - 702. All the combinations of A-Z and A-Z. 
    */
    
    let sum = 0;
    for (let letter of columnTitle) {
        let d = letter.charCodeAt(0) - 'A'.charCodeAt(0) + 1;
        sum = sum * 26 + d;
    }
    
    return sum;
};
Excel Sheet Column Number