In this post we will solve LeetCode 171Excel Sheet Column Number problem using the Java programming language.

If interested in this problem, I suggest you go to the LeetCode website and read the description of the problem in case something has changed. If you are still interested please read on.

Given a string columnTitle that represents the column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... Constraints: o 1 <= columnTitle.length <= 7 o columnTitle consists only of uppercase English letters. o columnTitle is in the range ["A", "FXSHRXW"]. Related Topics: o Math o String

The problem is relatively simple. We are given a string of uppercase characters each of which represents a digit in base 26. We need to compute the integer value associated with the string. Continue reading “LeetCode 171. Excel Sheet Column Number in Java”