From 095e654bbedcb33110ee45913ea8e61972e200e2 Mon Sep 17 00:00:00 2001 From: Richard Liu Date: Tue, 22 Feb 2022 02:09:27 -0800 Subject: [PATCH] 171 --- .../171. Excel Sheet Column Number/README.md | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/leetcode/171. Excel Sheet Column Number/README.md b/leetcode/171. Excel Sheet Column Number/README.md index 6293e94c..ed67879e 100644 --- a/leetcode/171. Excel Sheet Column Number/README.md +++ b/leetcode/171. Excel Sheet Column Number/README.md @@ -1,48 +1,53 @@ # [171. Excel Sheet Column Number (Easy)](https://leetcode.com/problems/excel-sheet-column-number/) -

Given a column title as appear in an Excel sheet, return its corresponding column number.

+

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 
-    ...
+
A -> 1
+B -> 2
+C -> 3
+...
+Z -> 26
+AA -> 27
+AB -> 28 
+...
 
+

 

Example 1:

-
Input: "A"
+
Input: columnTitle = "A"
 Output: 1
 

Example 2:

-
Input: "AB"
+
Input: columnTitle = "AB"
 Output: 28
 

Example 3:

-
Input: "ZY"
+
Input: columnTitle = "ZY"
 Output: 701
 
+

 

Constraints:

    -
  • 1 <= s.length <= 7
  • -
  • s consists only of uppercase English letters.
  • -
  • s is between "A" and "FXSHRXW".
  • +
  • 1 <= columnTitle.length <= 7
  • +
  • columnTitle consists only of uppercase English letters.
  • +
  • columnTitle is in the range ["A", "FXSHRXW"].
+**Companies**: +[Microsoft](https://leetcode.com/company/microsoft), [Bloomberg](https://leetcode.com/company/bloomberg) + **Related Topics**: -[Math](https://leetcode.com/tag/math/) +[Math](https://leetcode.com/tag/math/), [String](https://leetcode.com/tag/string/) **Similar Questions**: * [Excel Sheet Column Title (Easy)](https://leetcode.com/problems/excel-sheet-column-title/)