Skip to content

Commit

Permalink
feat: update lc problems (#2173)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Doocs Bot <[email protected]>
  • Loading branch information
acbin and idoocs authored Jan 2, 2024
1 parent 75b76e8 commit 8077754
Show file tree
Hide file tree
Showing 28 changed files with 134 additions and 172 deletions.
2 changes: 1 addition & 1 deletion solution/0000-0099/0006.Zigzag Conversion/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [6. N 字形变换](https://leetcode.cn/problems/zigzag-conversion)
# [6. Z 字形变换](https://leetcode.cn/problems/zigzag-conversion)

[English Version](/solution/0000-0099/0006.Zigzag%20Conversion/README_EN.md)

Expand Down
15 changes: 0 additions & 15 deletions solution/0100-0199/0195.Tenth Line/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,26 @@
<p>Assume that <code>file.txt</code> has the following content:</p>

<pre>

Line 1

Line 2

Line 3

Line 4

Line 5

Line 6

Line 7

Line 8

Line 9

Line 10

</pre>

<p>Your script should output the tenth line, which is:</p>

<pre>

Line 10

</pre>

<div class="spoilers"><b>Note:</b><br />

1. If the file contains less than 10 lines, what should you output?<br />

2. There&#39;s at least three different solutions. Try to explore all possibilities.</div>

## Solutions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,35 @@

<!-- 这里写题目描述 -->

<p>给你一个由一些多米诺骨牌组成的列表&nbsp;<code>dominoes</code>。</p>
<p>给你一组多米诺骨牌 <code>dominoes</code> 。</p>

<p>如果其中某一张多米诺骨牌可以通过旋转 <code>0</code>&nbsp;度或 <code>180</code> 度得到另一张多米诺骨牌,我们就认为这两张牌是等价的。</p>

<p>形式上,<code>dominoes[i] = [a, b]</code>&nbsp;&nbsp;<code>dominoes[j] = [c, d]</code>&nbsp;等价的前提是&nbsp;<code>a==c</code>&nbsp;&nbsp;<code>b==d</code>,或是&nbsp;<code>a==d</code> 且&nbsp;<code>b==c</code>。</p>
<p>形式上,<code>dominoes[i] = [a, b]</code> 与 <code>dominoes[j] = [c, d]</code> <strong>等价</strong> 当且仅当 (<code>a == c</code> 且 <code>b == d</code>) 或者 (<code>a == d</code> 且 <code>b == c</code>) 。即一张骨牌可以通过旋转 <code>0</code>&nbsp;度或 <code>180</code> 度得到另一张多米诺骨牌。</p>

<p>在&nbsp;<code>0 &lt;= i &lt; j &lt; dominoes.length</code>&nbsp;的前提下,找出满足&nbsp;<code>dominoes[i]</code> 和&nbsp;<code>dominoes[j]</code>&nbsp;等价的骨牌对 <code>(i, j)</code> 的数量。</p>

<p>&nbsp;</p>

<p><strong>示例:</strong></p>
<p><strong>示例 1:</strong></p>

<pre><strong>输入:</strong>dominoes = [[1,2],[2,1],[3,4],[5,6]]
<pre>
<strong>输入:</strong>dominoes = [[1,2],[2,1],[3,4],[5,6]]
<strong>输出:</strong>1
</pre>

<p><strong>示例 2:</strong></p>

<pre>
<strong>输入:</strong>dominoes = [[1,2],[1,2],[1,1],[1,2],[2,2]]
<strong>输出:</strong>3
</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ul>
<li><code>1 &lt;= dominoes.length &lt;= 40000</code></li>
<li><code>1 &lt;= dominoes.length &lt;= 4 * 10<sup>4</sup></code></li>
<li><code>dominoes[i].length == 2</code></li>
<li><code>1 &lt;= dominoes[i][j] &lt;= 9</code></li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [1135. 最低成本联通所有城市](https://leetcode.cn/problems/connecting-cities-with-minimum-cost)
# [1135. 最低成本连通所有城市](https://leetcode.cn/problems/connecting-cities-with-minimum-cost)

[English Version](/solution/1100-1199/1135.Connecting%20Cities%20With%20Minimum%20Cost/README_EN.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<p>这里有&nbsp;<code>n</code>&nbsp;个一样的骰子,每个骰子上都有&nbsp;<code>k</code>&nbsp;个面,分别标号为&nbsp;<code>1</code>&nbsp;到 <code>k</code> 。</p>

<p>给定三个整数 <code>n</code> ,&nbsp; <code>k</code> 和&nbsp;<code>target</code>&nbsp;,返回可能的方式(从总共<em>&nbsp;</em><code>k<sup>n</sup></code><em>&nbsp;</em>种方式中)滚动骰子的数量,使正面朝上的数字之和等于<em>&nbsp;</em><code>target</code>&nbsp;。</p>
<p>给定三个整数 <code>n</code><code>k</code> 和 <code>target</code>,请返回投掷骰子的所有可能得到的结果(共有 <code>k<sup>n</sup></code> 种方式),使得骰子面朝上的数字总和等于 <code>target</code>。</p>

<p>答案可能很大,你需要对&nbsp;<code>10<sup>9</sup>&nbsp;+ 7</code> <strong>取模</strong>&nbsp;。</p>
<p>由于答案可能很大,你需要对 <code>10<sup>9</sup> + 7</code> <strong>取模</strong>。</p>

<p>&nbsp;</p>

Expand All @@ -19,25 +19,25 @@
<pre>
<strong>输入:</strong>n = 1, k = 6, target = 3
<strong>输出:</strong>1
<strong>解释:</strong>你扔一个有 6 个面的骰子。
得到 3 的和只有一种方法
<strong>解释:</strong>你掷了一个有 6 个面的骰子。
得到总和为 3 的结果的方式只有一种
</pre>

<p><strong>示例 2:</strong></p>

<pre>
<strong>输入:</strong>n = 2, k = 6, target = 7
<strong>输出:</strong>6
<strong>解释:</strong>你扔两个骰子,每个骰子有 6 个面。
得到 7 的和有 6 种方法:1+6 2+5 3+4 4+3 5+2 6+1。
<strong>解释:</strong>你掷了两个骰子,每个骰子有 6 个面。
有 6 种方式得到总和为 7 的结果: 1+6, 2+5, 3+4, 4+3, 5+2, 6+1。
</pre>

<p><strong>示例 3:</strong></p>

<pre>
<strong>输入:</strong>n = 30, k = 30, target = 500
<strong>输出:</strong>222616187
<strong>解释:</strong>返回的结果必须是对 10<sup>9</sup> + 7 取模。</pre>
<strong>解释:</strong>返回的结果必须对 10<sup>9</sup> + 7 取模。</pre>

<p>&nbsp;</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Description

<p>You have <code>n</code> dice, and each die has <code>k</code> faces numbered from <code>1</code> to <code>k</code>.</p>
<p>You have <code>n</code> dice, and each dice has <code>k</code> faces numbered from <code>1</code> to <code>k</code>.</p>

<p>Given three integers <code>n</code>, <code>k</code>, and <code>target</code>, return <em>the number of possible ways (out of the </em><code>k<sup>n</sup></code><em> total ways) </em><em>to roll the dice, so the sum of the face-up numbers equals </em><code>target</code>. Since the answer may be too large, return it <strong>modulo</strong> <code>10<sup>9</sup> + 7</code>.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,31 @@

<p><strong>示例 1:</strong></p>

<pre><strong>输入:</strong>words = [&quot;cat&quot;,&quot;bt&quot;,&quot;hat&quot;,&quot;tree&quot;], chars = &quot;atach&quot;
<pre>
<strong>输入:</strong>words = ["cat","bt","hat","tree"], chars = "atach"
<strong>输出:</strong>6
<strong>解释: </strong>
可以形成字符串 &quot;cat&quot;&quot;hat&quot;,所以答案是 3 + 3 = 6。
可以形成字符串 "cat""hat",所以答案是 3 + 3 = 6。
</pre>

<p><strong>示例 2:</strong></p>

<pre><strong>输入:</strong>words = [&quot;hello&quot;,&quot;world&quot;,&quot;leetcode&quot;], chars = &quot;welldonehoneyr&quot;
<pre>
<strong>输入:</strong>words = ["hello","world","leetcode"], chars = "welldonehoneyr"
<strong>输出:</strong>10
<strong>解释:</strong>
可以形成字符串 &quot;hello&quot;&quot;world&quot;,所以答案是 5 + 5 = 10。
可以形成字符串 "hello""world",所以答案是 5 + 5 = 10。
</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ol>
<ul>
<li><code>1 &lt;= words.length &lt;= 1000</code></li>
<li><code>1 &lt;= words[i].length, chars.length&nbsp;&lt;= 100</code></li>
<li>所有字符串中都仅包含小写英文字母</li>
</ol>
</ul>

## 解法

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# [1167. 连接棒材的最低费用](https://leetcode.cn/problems/minimum-cost-to-connect-sticks)
# [1167. 连接木棍的最低费用](https://leetcode.cn/problems/minimum-cost-to-connect-sticks)

[English Version](/solution/1100-1199/1167.Minimum%20Cost%20to%20Connect%20Sticks/README_EN.md)

## 题目描述

<!-- 这里写题目描述 -->

<p>你有一些长度为正整数的棍子。这些长度以数组<meta charset="UTF-8" />&nbsp;<code>sticks</code>&nbsp;的形式给出,<meta charset="UTF-8" />&nbsp;<code>sticks[i]</code>&nbsp; <code>第i个</code> 木棍的长度。</p>
<p>你有一些长度为正整数的木棍。这些长度以数组<meta charset="UTF-8" />&nbsp;<code>sticks</code>&nbsp;的形式给出,<meta charset="UTF-8" />&nbsp;<code>sticks[i]</code>&nbsp;是第 <code>i</code> 个木棍的长度。</p>

<p>你可以通过支付 <code>x + y</code> 的成本将任意两个长度为 <code>x</code> 和 <code>y</code> 的棍子连接成一个棍子。你必须连接所有的棍子,直到剩下一个棍子。</p>
<p>你可以通过支付 <code>x + y</code> 的成本将任意两个长度为 <code>x</code> 和 <code>y</code> 的木棍连接成一个木棍。你必须连接所有的木棍,直到剩下一个木棍。</p>

<p>返回以这种方式将所有给定的棍子连接成一个棍子的 <em>最小成本</em> 。</p>
<p>返回以这种方式将所有给定的木棍连接成一个木棍的<em> 最小成本 </em>。</p>

<p>&nbsp;</p>

Expand Down
2 changes: 1 addition & 1 deletion solution/1200-1299/1216.Valid Palindrome III/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [1216. 验证回文字符串 III](https://leetcode.cn/problems/valid-palindrome-iii)
# [1216. 验证回文串 III](https://leetcode.cn/problems/valid-palindrome-iii)

[English Version](/solution/1200-1299/1216.Valid%20Palindrome%20III/README_EN.md)

Expand Down
39 changes: 12 additions & 27 deletions solution/1200-1299/1222.Queens That Can Attack the King/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,42 @@

<!-- 这里写题目描述 -->

<p>在一个&nbsp;<strong>8x8</strong>&nbsp;的棋盘上,放置着若干「黑皇后」和一个「白国王」。</p>
<p>在一个 <strong>下标从 0 开始</strong> 的 <code>8 x 8</code> 棋盘上,可能有多个黑皇后和一个白国王。</p>

<p>给定一个由整数坐标组成的数组&nbsp;<code>queens</code>&nbsp;,表示黑皇后的位置;以及一对坐标&nbsp;<code>king</code> ,表示白国王的位置,返回所有可以攻击国王的皇后的坐标(任意顺序)。</p>
<p>给你一个二维整数数组 <code>queens</code>,其中 <code>queens[i] = [xQueeni, yQueeni]</code> 表示第 <code>i</code> 个黑皇后在棋盘上的位置。还给你一个长度为 <code>2</code> 的整数数组 <code>king</code>,其中 <code>king = [xKing, yKing]</code> 表示白国王的位置。</p>

<p>返回 <em>能够直接攻击国王的黑皇后的坐标</em>。你可以以 <strong>任何顺序</strong> 返回答案。</p>

<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>

<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1222.Queens%20That%20Can%20Attack%20the%20King/images/untitled-diagram.jpg" /></p>
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1222.Queens%20That%20Can%20Attack%20the%20King/images/1703052515-HqjAJq-chess1.jpg" style="width: 400px; height: 400px;" /></p>

<pre>
<strong>输入:</strong>queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]
<strong>输出:</strong>[[0,1],[1,0],[3,3]]
<strong>解释:</strong>
[0,1] 的皇后可以攻击到国王,因为他们在同一行上。
[1,0] 的皇后可以攻击到国王,因为他们在同一列上。
[3,3] 的皇后可以攻击到国王,因为他们在同一条对角线上。
[0,4] 的皇后无法攻击到国王,因为她被位于 [0,1] 的皇后挡住了。
[4,0] 的皇后无法攻击到国王,因为她被位于 [1,0] 的皇后挡住了。
[2,4] 的皇后无法攻击到国王,因为她和国王不在同一行/列/对角线上。
<strong>解释:</strong>上面的图示显示了三个可以直接攻击国王的皇后和三个不能攻击国王的皇后(用红色虚线标记)。
</pre>

<p><strong>示例 2:</strong></p>

<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1222.Queens%20That%20Can%20Attack%20the%20King/images/untitled-diagram-1.jpg" /></strong></p>
<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1222.Queens%20That%20Can%20Attack%20the%20King/images/1703052660-bPPflt-chess2.jpg" style="width: 400px; height: 400px;" /></strong></p>

<pre>
<strong>输入:</strong>queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]
<strong>输出:</strong>[[2,2],[3,4],[4,4]]
</pre>

<p><strong>示例 3:</strong></p>

<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1222.Queens%20That%20Can%20Attack%20the%20King/images/untitled-diagram-2.jpg" /></strong></p>

<pre>
<strong>输入:</strong>queens = [[5,6],[7,7],[2,1],[0,7],[1,6],[5,1],[3,7],[0,3],[4,0],[1,2],[6,3],[5,0],[0,4],[2,2],[1,1],[6,4],[5,4],[0,0],[2,6],[4,5],[5,2],[1,4],[7,5],[2,3],[0,5],[4,2],[1,0],[2,7],[0,1],[4,6],[6,1],[0,6],[4,3],[1,7]], king = [3,4]
<strong>输出:</strong>[[2,3],[1,4],[1,6],[3,7],[4,3],[5,4],[4,5]]
</pre>
<strong>解释:</strong>上面的图示显示了三个能够直接攻击国王的黑皇后和三个不能攻击国王的黑皇后(用红色虚线标记)。</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ul>
<li><code>1 &lt;= queens.length&nbsp;&lt;= 63</code></li>
<li><code>queens[i].length == 2</code></li>
<li><code>0 &lt;= queens[i][j] &lt;&nbsp;8</code></li>
<li><code>king.length == 2</code></li>
<li><code>0 &lt;= king[0], king[1] &lt; 8</code></li>
<li>一个棋盘格上最多只能放置一枚棋子。</li>
<li><meta charset="UTF-8" /><code>1 &lt;= queens.length &lt; 64</code></li>
<li><code>queens[i].length == king.length == 2</code></li>
<li><code>0 &lt;= xQueen<sub>i</sub>, yQueen<sub>i</sub>, xKing, yKing &lt; 8</code></li>
<li>所有给定的位置都是 <strong>唯一</strong> 的。</li>
</ul>

## 解法
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<p>Alice 把 <code>n</code> 个气球排列在一根绳子上。给你一个下标从 <strong>0</strong> 开始的字符串 <code>colors</code> ,其中 <code>colors[i]</code> 是第 <code>i</code> 个气球的颜色。</p>

<p>Alice 想要把绳子装扮成 <strong>彩色</strong> ,且她不希望两个连续的气球涂着相同的颜色,所以她喊来 Bob 帮忙。Bob 可以从绳子上移除一些气球使绳子变成 <strong>彩色</strong> 。给你一个下标从 <strong>0</strong> 开始的整数数组 <code>neededTime</code> ,其中 <code>neededTime[i]</code> 是 Bob 从绳子上移除第 <code>i</code> 个气球需要的时间(以秒为单位)。</p>
<p>Alice 想要把绳子装扮成 <b>五颜六色的</b>&nbsp;,且她不希望两个连续的气球涂着相同的颜色,所以她喊来 Bob 帮忙。Bob 可以从绳子上移除一些气球使绳子变成 <strong>彩色</strong> 。给你一个 <strong>下标从 0 开始&nbsp;</strong>的整数数组 <code>neededTime</code> ,其中 <code>neededTime[i]</code> 是 Bob 从绳子上移除第 <code>i</code> 个气球需要的时间(以秒为单位)。</p>

<p>返回 Bob 使绳子变成 <strong>彩色</strong> 需要的 <strong>最少时间</strong> 。</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ There are no longer two consecutive balloons of the same color. Total time = 3.<
<pre>
<strong>Input:</strong> colors = &quot;aabaa&quot;, neededTime = [1,2,3,4,1]
<strong>Output:</strong> 2
<strong>Explanation:</strong> Bob will remove the ballons at indices 0 and 4. Each ballon takes 1 second to remove.
<strong>Explanation:</strong> Bob will remove the balloons at indices 0 and 4. Each balloons takes 1 second to remove.
There are no longer two consecutive balloons of the same color. Total time = 1 + 1 = 2.
</pre>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,37 @@

<!-- 这里写题目描述 -->

<p>给你一个大小为 <code>rows x cols</code> 的矩阵 <code>mat</code>,其中 <code>mat[i][j]</code> 是 <code>0</code> 或 <code>1</code>,请返回 <strong>矩阵&nbsp;<em><code>mat</code></em> 中特殊位置的数目</strong> 。</p>
<p>给定一个 <code>m x n</code> 的二进制矩阵 <code>mat</code>,返回矩阵 <code>mat</code> 中特殊位置的数量。</p>

<p><strong>特殊位置</strong> 定义:如果 <code>mat[i][j] == 1</code> 并且第 <code>i</code> 行和第 <code>j</code> 列中的所有其他元素均为 <code>0</code>(行和列的下标均 <strong>从 0 开始</strong> ),则位置 <code>(i, j)</code> 被称为特殊位置。</p>
<p>如果位置 <code>(i, j)</code> 满足 <code>mat[i][j] == 1</code> 并且行 <code>i</code> 与列 <code>j</code> 中的所有其他元素都是 <code>0</code>(行和列的下标从 <strong>0 </strong>开始计数),那么它被称为<strong> 特殊 </strong>位置。</p>

<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>

<pre><strong>输入:</strong>mat = [[1,0,0],
&nbsp; [0,0,<strong>1</strong>],
&nbsp; [1,0,0]]
<p><strong class="example">示例 1:</strong></p>
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1582.Special%20Positions%20in%20a%20Binary%20Matrix/images/special1.jpg" style="width: 244px; height: 245px;" />
<pre>
<strong>输入:</strong>mat = [[1,0,0],[0,0,1],[1,0,0]]
<strong>输出:</strong>1
<strong>解释:</strong>(1,2) 是一个特殊位置,因为 mat[1][2] == 1 且所处的行和列上所有其他元素都是 0
</pre>

<p><strong>示例 2:</strong></p>

<pre><strong>输入:</strong>mat = [[<strong>1</strong>,0,0],
&nbsp; [0,<strong>1</strong>,0],
&nbsp; [0,0,<strong>1</strong>]]
<strong>输出:</strong>3
<strong>解释:</strong>(0,0), (1,1) 和 (2,2) 都是特殊位置
<strong>解释:</strong>位置 (1, 2) 是一个特殊位置,因为 mat[1][2] == 1 且第 1 行和第 2 列的其他所有元素都是 0。
</pre>

<p><strong>示例 3:</strong></p>

<pre><strong>输入:</strong>mat = [[0,0,0,<strong>1</strong>],
&nbsp; [<strong>1</strong>,0,0,0],
&nbsp; [0,1,1,0],
&nbsp; [0,0,0,0]]
<strong>输出:</strong>2
</pre>

<p><strong>示例 4:</strong></p>

<pre><strong>输入:</strong>mat = [[0,0,0,0,0],
&nbsp; [<strong>1</strong>,0,0,0,0],
&nbsp; [0,<strong>1</strong>,0,0,0],
&nbsp; [0,0,<strong>1</strong>,0,0],
&nbsp; [0,0,0,1,1]]
<p><strong class="example">示例 2:</strong></p>
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1582.Special%20Positions%20in%20a%20Binary%20Matrix/images/special-grid.jpg" style="width: 244px; height: 245px;" />
<pre>
<strong>输入:</strong>mat = [[1,0,0],[0,1,0],[0,0,1]]
<strong>输出:</strong>3
<strong>解释:</strong>位置 (0, 0),(1, 1) 和 (2, 2) 都是特殊位置。
</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>

<ul>
<li><code>rows == mat.length</code></li>
<li><code>cols == mat[i].length</code></li>
<li><code>1 &lt;= rows, cols &lt;= 100</code></li>
<li><code>mat[i][j]</code> 是 <code>0</code> 或 <code>1</code></li>
<li><code>m == mat.length</code></li>
<li><code>n == mat[i].length</code></li>
<li><code>1 &lt;= m, n &lt;= 100</code></li>
<li><code>mat[i][j]</code> 是 <code>0</code> 或 <code>1</code></li>
</ul>

## 解法
Expand Down
2 changes: 1 addition & 1 deletion solution/2600-2699/2668.Find Latest Salaries/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Each row contains employees details and their yearly salaries, however, some of
</strong>
<strong>Explanation:</strong>
- emp_id 1 has two records with a salary of&nbsp;110000, 106119 out of these 110000 is an updated salary (Assuming salary is increasing each year)
- emp_id 2 has two records with a salary of&nbsp;128922, 128922&nbsp;out of these 130000 is an updated salary.
- emp_id 2 has two records with a salary of&nbsp;128922, 130000&nbsp;out of these 130000 is an updated salary.
- emp_id 3 has only one salary record so that is already an updated salary.
- emp_id 4&nbsp;has two records with a salary of&nbsp;162825, 170000&nbsp;out of these 170000 is an updated salary.
- emp_id 5&nbsp;has only one salary record so that is already an updated salary.
Expand Down
2 changes: 1 addition & 1 deletion solution/2700-2799/2735.Collecting Chocolates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- 这里写题目描述 -->

<p>给你一个长度为 <code>n</code> 、下标从 <strong>0</strong> 开始的整数数组 <code>nums</code> ,表示收集不同巧克力的成本。每个巧克力都对应一个不同的类型,最初,位于下标 <code>i</code> 的巧克力就对应第 <code>i</code> 个类型。</p>
<p>给你一个长度为 <code>n</code>、下标从 <strong>0</strong> 开始的整数数组 <code>nums</code>,<code>nums[i]</code> 表示收集位于下标 <code>i</code> 处的巧克力成本。每个巧克力都对应一个不同的类型,最初,位于下标 <code>i</code> 的巧克力就对应第 <code>i</code> 个类型。</p>

<p>在一步操作中,你可以用成本 <code>x</code> 执行下述行为:</p>

Expand Down
Loading

0 comments on commit 8077754

Please sign in to comment.