Excel Sheet Column Number – LeetCode 171
Problem
Description
Given a column title as appear in an Excel sheet, return its corresponding column number.
Example
A -> 1
B -> 2
C -> 3
…
Z -> 26
AA -> 27
AB -> 28
Answer
Original
Code
1 | class Solution { |
思路
没什么思路,水题。时间复杂度$O(n)$,空间复杂度$O(1)$。
耗时$6$ ms,排名$90.91\%$
Better
思路
没有看到更好的思路。