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

30:00

Excel Sheet Column Number
easy
Topics
Companies

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

Example 1:
Input: "A"
Output: 1
Constraints:
  • 1columnTitle.length71 \leq \text{columnTitle.length} \leq 7

  • columnTitle consists only of uppercase English letters.

  • columnTitle is in the range ["A","FXSHRXW"][\text{"A"}, \text{"FXSHRXW"}].

Input
arr ="A"

Convert to number

A

A = 1× 260
1

1 × 260 = 0

Column Title

"A"

Column Number

0

Position: 0/1
Current sum: 0
Base-26 system: A=1, B=2, ..., Z=26
Variables
VariableValue
columnTitleA
DepthFunction Call
Stack empty
0/2