代码拉取完成,页面将自动刷新
<p>A cell <code>(r, c)</code> of an excel sheet is represented as a string <code>"<col><row>"</code> where:</p>
<ul>
<li><code><col></code> denotes the column number <code>c</code> of the cell. It is represented by <strong>alphabetical letters</strong>.
<ul>
<li>For example, the <code>1<sup>st</sup></code> column is denoted by <code>'A'</code>, the <code>2<sup>nd</sup></code> by <code>'B'</code>, the <code>3<sup>rd</sup></code> by <code>'C'</code>, and so on.</li>
</ul>
</li>
<li><code><row></code> is the row number <code>r</code> of the cell. The <code>r<sup>th</sup></code> row is represented by the <strong>integer</strong> <code>r</code>.</li>
</ul>
<p>You are given a string <code>s</code> in the format <code>"<col1><row1>:<col2><row2>"</code>, where <code><col1></code> represents the column <code>c1</code>, <code><row1></code> represents the row <code>r1</code>, <code><col2></code> represents the column <code>c2</code>, and <code><row2></code> represents the row <code>r2</code>, such that <code>r1 <= r2</code> and <code>c1 <= c2</code>.</p>
<p>Return <em>the <strong>list of cells</strong></em> <code>(x, y)</code> <em>such that</em> <code>r1 <= x <= r2</code> <em>and</em> <code>c1 <= y <= c2</code>. The cells should be represented as <strong>strings</strong> in the format mentioned above and be sorted in <strong>non-decreasing</strong> order first by columns and then by rows.</p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2022/02/08/ex1drawio.png" style="width: 250px; height: 160px;" />
<pre>
<strong>Input:</strong> s = "K1:L2"
<strong>Output:</strong> ["K1","K2","L1","L2"]
<strong>Explanation:</strong>
The above diagram shows the cells which should be present in the list.
The red arrows denote the order in which the cells should be presented.
</pre>
<p><strong class="example">Example 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2022/02/09/exam2drawio.png" style="width: 500px; height: 50px;" />
<pre>
<strong>Input:</strong> s = "A1:F1"
<strong>Output:</strong> ["A1","B1","C1","D1","E1","F1"]
<strong>Explanation:</strong>
The above diagram shows the cells which should be present in the list.
The red arrow denotes the order in which the cells should be presented.
</pre>
<p> </p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>s.length == 5</code></li>
<li><code>'A' <= s[0] <= s[3] <= 'Z'</code></li>
<li><code>'1' <= s[1] <= s[4] <= '9'</code></li>
<li><code>s</code> consists of uppercase English letters, digits and <code>':'</code>.</li>
</ul>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。