Skip to content

Commit 095e654

Browse files
committed
171
1 parent c0e2fec commit 095e654

File tree

1 file changed

+21
-16
lines changed
  • leetcode/171. Excel Sheet Column Number

1 file changed

+21
-16
lines changed

leetcode/171. Excel Sheet Column Number/README.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
11
# [171. Excel Sheet Column Number (Easy)](https://leetcode.com/problems/excel-sheet-column-number/)
22

3-
<p>Given a column title as appear in an Excel sheet, return its corresponding column number.</p>
3+
<p>Given a string <code>columnTitle</code> that represents the column title as appear in an Excel sheet, return <em>its corresponding column number</em>.</p>
44

55
<p>For example:</p>
66

7-
<pre> A -&gt; 1
8-
B -&gt; 2
9-
C -&gt; 3
10-
...
11-
Z -&gt; 26
12-
AA -&gt; 27
13-
AB -&gt; 28
14-
...
7+
<pre>A -&gt; 1
8+
B -&gt; 2
9+
C -&gt; 3
10+
...
11+
Z -&gt; 26
12+
AA -&gt; 27
13+
AB -&gt; 28
14+
...
1515
</pre>
1616

17+
<p>&nbsp;</p>
1718
<p><strong>Example 1:</strong></p>
1819

19-
<pre><strong>Input:</strong> "A"
20+
<pre><strong>Input:</strong> columnTitle = "A"
2021
<strong>Output:</strong> 1
2122
</pre>
2223

2324
<p><strong>Example 2:</strong></p>
2425

25-
<pre><strong>Input: </strong>"AB"
26+
<pre><strong>Input:</strong> columnTitle = "AB"
2627
<strong>Output:</strong> 28
2728
</pre>
2829

2930
<p><strong>Example 3:</strong></p>
3031

31-
<pre><strong>Input: </strong>"ZY"
32+
<pre><strong>Input:</strong> columnTitle = "ZY"
3233
<strong>Output:</strong> 701
3334
</pre>
35+
3436
<p>&nbsp;</p>
3537
<p><strong>Constraints:</strong></p>
3638

3739
<ul>
38-
<li><code>1 &lt;= s.length &lt;= 7</code></li>
39-
<li><code>s</code> consists only of uppercase English letters.</li>
40-
<li><code>s</code> is between "A" and "FXSHRXW".</li>
40+
<li><code>1 &lt;= columnTitle.length &lt;= 7</code></li>
41+
<li><code>columnTitle</code> consists only of uppercase English letters.</li>
42+
<li><code>columnTitle</code> is in the range <code>["A", "FXSHRXW"]</code>.</li>
4143
</ul>
4244

4345

46+
**Companies**:
47+
[Microsoft](https://leetcode.com/company/microsoft), [Bloomberg](https://leetcode.com/company/bloomberg)
48+
4449
**Related Topics**:
45-
[Math](https://leetcode.com/tag/math/)
50+
[Math](https://leetcode.com/tag/math/), [String](https://leetcode.com/tag/string/)
4651

4752
**Similar Questions**:
4853
* [Excel Sheet Column Title (Easy)](https://leetcode.com/problems/excel-sheet-column-title/)

0 commit comments

Comments
 (0)