171_Excel Sheet Column Number
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
Example 1:
Example 2:
Example 3:
Solution:
Idea:
This problem is basically the problem of converting a string representing a base 26 number to the corresponding integer.
Note that "A" correspond to 1 not 0.
Time Complexity: where n is the number of characters in the input string.
Space Complexity:
Code 1: Iterative approach
Code 2: Recursive approach
Last updated