Skip to content

Commit 625a3e9

Browse files
committed
feat: update lc problems
1 parent a45c493 commit 625a3e9

File tree

26 files changed

+44
-52
lines changed

26 files changed

+44
-52
lines changed

solution/0100-0199/0179.Largest Number/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public class Comparer: IComparer<string>
128128
{
129129
return Compare(left, right, 0, 0);
130130
}
131-
131+
132132
private int Compare(string left, string right, int lBegin, int rBegin)
133133
{
134134
var len = Math.Min(left.Length - lBegin, right.Length - rBegin);
@@ -139,7 +139,7 @@ public class Comparer: IComparer<string>
139139
return left[lBegin + i] < right[rBegin + i] ? -1 : 1;
140140
}
141141
}
142-
142+
143143
if (left.Length - lBegin == right.Length - rBegin)
144144
{
145145
return 0;
@@ -159,7 +159,7 @@ public class Solution {
159159
public string LargestNumber(int[] nums) {
160160
var sb = new StringBuilder();
161161
var strs = nums.Select(n => n.ToString(CultureInfo.InvariantCulture)).OrderByDescending(s => s, new Comparer());
162-
162+
163163
var nonZeroOccurred = false;
164164
foreach (var str in strs)
165165
{

solution/0100-0199/0179.Largest Number/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class Comparer: IComparer<string>
115115
{
116116
return Compare(left, right, 0, 0);
117117
}
118-
118+
119119
private int Compare(string left, string right, int lBegin, int rBegin)
120120
{
121121
var len = Math.Min(left.Length - lBegin, right.Length - rBegin);
@@ -126,7 +126,7 @@ public class Comparer: IComparer<string>
126126
return left[lBegin + i] < right[rBegin + i] ? -1 : 1;
127127
}
128128
}
129-
129+
130130
if (left.Length - lBegin == right.Length - rBegin)
131131
{
132132
return 0;
@@ -146,7 +146,7 @@ public class Solution {
146146
public string LargestNumber(int[] nums) {
147147
var sb = new StringBuilder();
148148
var strs = nums.Select(n => n.ToString(CultureInfo.InvariantCulture)).OrderByDescending(s => s, new Comparer());
149-
149+
150150
var nonZeroOccurred = false;
151151
foreach (var str in strs)
152152
{

solution/0300-0399/0315.Count of Smaller Numbers After Self/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>You are given an integer array <code>nums</code> and you have to return a new <code>counts</code> array. The <code>counts</code> array has the property where <code>counts[i]</code> is the number of smaller elements to the right of <code>nums[i]</code>.</p>
7+
<p>Given an integer array <code>nums</code>, return<em> an integer array </em><code>counts</code><em> where </em><code>counts[i]</code><em> is the number of smaller elements to the right of </em><code>nums[i]</code>.</p>
88

99
<p>&nbsp;</p>
1010
<p><strong>Example 1:</strong></p>

solution/0300-0399/0347.Top K Frequent Elements/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
<ul>
2121
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
22+
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
2223
<li><code>k</code> is in the range <code>[1, the number of unique elements in the array]</code>.</li>
2324
<li>It is <strong>guaranteed</strong> that the answer is <strong>unique</strong>.</li>
2425
</ul>

solution/0500-0599/0593.Valid Square/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>给定2D空间中四个点的坐标&nbsp;<code>p1</code>,&nbsp;<code>p2</code>,&nbsp;<code>p3</code>&nbsp;&nbsp;<code>p4</code>,如果这四个点构成一个正方形,则返回 <code>true</code> 。</p>
1010

11-
<p>点的坐标&nbsp;<code>p<sub>i</sub></code> 表示为 <code>[xi, yi]</code> 。输入 <strong>不是</strong> 按任何顺序给出的。</p>
11+
<p>点的坐标&nbsp;<code>p<sub>i</sub></code> 表示为 <code>[xi, yi]</code> 。 <code>输入没有任何顺序</code> 。</p>
1212

1313
<p>一个 <strong>有效的正方形</strong> 有四条等边和四个等角(90度角)。</p>
1414

solution/0600-0699/0622.Design Circular Queue/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,37 +195,37 @@ public:
195195
q = vector<int>(k);
196196
front = size = 0;
197197
}
198-
198+
199199
bool enQueue(int value) {
200200
if (isFull()) return false;
201201
int idx = (front + size) % capacity;
202202
q[idx] = value;
203203
++size;
204204
return true;
205205
}
206-
206+
207207
bool deQueue() {
208208
if (isEmpty()) return false;
209209
front = (front + 1) % capacity;
210210
--size;
211211
return true;
212212
}
213-
213+
214214
int Front() {
215215
if (isEmpty()) return -1;
216216
return q[front];
217217
}
218-
218+
219219
int Rear() {
220220
if (isEmpty()) return -1;
221221
int idx = (front + size - 1) % capacity;
222222
return q[idx];
223223
}
224-
224+
225225
bool isEmpty() {
226226
return size == 0;
227227
}
228-
228+
229229
bool isFull() {
230230
return size == capacity;
231231
}

solution/0600-0699/0622.Design Circular Queue/README_EN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,37 +194,37 @@ public:
194194
q = vector<int>(k);
195195
front = size = 0;
196196
}
197-
197+
198198
bool enQueue(int value) {
199199
if (isFull()) return false;
200200
int idx = (front + size) % capacity;
201201
q[idx] = value;
202202
++size;
203203
return true;
204204
}
205-
205+
206206
bool deQueue() {
207207
if (isEmpty()) return false;
208208
front = (front + 1) % capacity;
209209
--size;
210210
return true;
211211
}
212-
212+
213213
int Front() {
214214
if (isEmpty()) return -1;
215215
return q[front];
216216
}
217-
217+
218218
int Rear() {
219219
if (isEmpty()) return -1;
220220
int idx = (front + size - 1) % capacity;
221221
return q[idx];
222222
}
223-
223+
224224
bool isEmpty() {
225225
return size == 0;
226226
}
227-
227+
228228
bool isFull() {
229229
return size == capacity;
230230
}

solution/0600-0699/0638.Shopping Offers/README_EN.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ You cannot add more items, though only $9 for 2A ,2B and 1C.
3939
<p><strong>Constraints:</strong></p>
4040

4141
<ul>
42-
<li><code>n == price.length</code></li>
43-
<li><code>n == needs.length</code></li>
42+
<li><code>n == price.length == needs.length</code></li>
4443
<li><code>1 &lt;= n &lt;= 6</code></li>
45-
<li><code>0 &lt;= price[i] &lt;= 10</code></li>
46-
<li><code>0 &lt;= needs[i] &lt;= 10</code></li>
44+
<li><code>0 &lt;= price[i], needs[i] &lt;= 10</code></li>
4745
<li><code>1 &lt;= special.length &lt;= 100</code></li>
4846
<li><code>special[i].length == n + 1</code></li>
4947
<li><code>0 &lt;= special[i][j] &lt;= 50</code></li>

solution/0800-0899/0802.Find Eventual Safe States/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ var eventualSafeNodes = function (graph) {
322322
* @param {number[][]} graph
323323
* @return {number[]}
324324
*/
325-
var eventualSafeNodes = function(graph) {
325+
var eventualSafeNodes = function (graph) {
326326
const n = graph.length;
327327
const color = new Array(n).fill(0);
328328
function dfs(i) {

solution/0800-0899/0802.Find Eventual Safe States/Solution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @param {number[][]} graph
33
* @return {number[]}
44
*/
5-
var eventualSafeNodes = function(graph) {
5+
var eventualSafeNodes = function (graph) {
66
const n = graph.length;
77
const color = new Array(n).fill(0);
88
function dfs(i) {
@@ -25,4 +25,4 @@
2525
}
2626
}
2727
return ans;
28-
};
28+
};

0 commit comments

Comments
 (0)