Skip to content

Commit 1302cfc

Browse files
authored
feat: add biweekly contest 179 (#5121)
1 parent e09f1fe commit 1302cfc

38 files changed

Lines changed: 1306 additions & 28 deletions

File tree

solution/0600-0699/0602.Friend Requests II Who Has the Most Friends/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This table contains the ID of the user who sent the request, the ID of the user
4242
<p><strong class="example">Example 1:</strong></p>
4343

4444
<pre>
45-
<strong>Input:</strong>
45+
<strong>Input:</strong>
4646
RequestAccepted table:
4747
+--------------+-------------+-------------+
4848
| requester_id | accepter_id | accept_date |
@@ -52,13 +52,13 @@ RequestAccepted table:
5252
| 2 | 3 | 2016/06/08 |
5353
| 3 | 4 | 2016/06/09 |
5454
+--------------+-------------+-------------+
55-
<strong>Output:</strong>
55+
<strong>Output:</strong>
5656
+----+-----+
5757
| id | num |
5858
+----+-----+
5959
| 3 | 3 |
6060
+----+-----+
61-
<strong>Explanation:</strong>
61+
<strong>Explanation:</strong>
6262
The person with id 3 is a friend of people 1, 2, and 4, so he has three friends in total, which is the most number than any others.
6363
</pre>
6464

solution/0600-0699/0630.Course Schedule III/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ tags:
3131
<pre>
3232
<strong>Input:</strong> courses = [[100,200],[200,1300],[1000,1250],[2000,3200]]
3333
<strong>Output:</strong> 3
34-
Explanation:
34+
Explanation:
3535
There are totally 4 courses, but you can take 3 courses at most:
3636
First, take the 1<sup>st</sup> course, it costs 100 days so you will finish it on the 100<sup>th</sup> day, and ready to take the next course on the 101<sup>st</sup> day.
37-
Second, take the 3<sup>rd</sup> course, it costs 1000 days so you will finish it on the 1100<sup>th</sup> day, and ready to take the next course on the 1101<sup>st</sup> day.
38-
Third, take the 2<sup>nd</sup> course, it costs 200 days so you will finish it on the 1300<sup>th</sup> day.
37+
Second, take the 3<sup>rd</sup> course, it costs 1000 days so you will finish it on the 1100<sup>th</sup> day, and ready to take the next course on the 1101<sup>st</sup> day.
38+
Third, take the 2<sup>nd</sup> course, it costs 200 days so you will finish it on the 1300<sup>th</sup> day.
3939
The 4<sup>th</sup> course cannot be taken now, since you will finish it on the 3300<sup>th</sup> day, which exceeds the closed date.
4040
</pre>
4141

solution/0600-0699/0647.Palindromic Substrings/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,16 @@ func countSubstrings(s string) int {
313313

314314
```ts
315315
function countSubstrings(s: string): number {
316-
let t = "^#";
316+
let t = '^#';
317317
for (const c of s) {
318-
t += c + "#";
318+
t += c + '#';
319319
}
320-
t += "$";
320+
t += '$';
321321

322322
const n = t.length;
323323
const p: number[] = new Array(n).fill(0);
324-
let pos = 0, maxRight = 0;
324+
let pos = 0,
325+
maxRight = 0;
325326
let ans = 0;
326327

327328
for (let i = 1; i < n - 1; i++) {

solution/0600-0699/0647.Palindromic Substrings/README_EN.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,16 @@ func countSubstrings(s string) int {
312312

313313
```ts
314314
function countSubstrings(s: string): number {
315-
let t = "^#";
315+
let t = '^#';
316316
for (const c of s) {
317-
t += c + "#";
317+
t += c + '#';
318318
}
319-
t += "$";
319+
t += '$';
320320

321321
const n = t.length;
322322
const p: number[] = new Array(n).fill(0);
323-
let pos = 0, maxRight = 0;
323+
let pos = 0,
324+
maxRight = 0;
324325
let ans = 0;
325326

326327
for (let i = 1; i < n - 1; i++) {

solution/0600-0699/0647.Palindromic Substrings/Solution2.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
function countSubstrings(s: string): number {
2-
let t = "^#";
2+
let t = '^#';
33
for (const c of s) {
4-
t += c + "#";
4+
t += c + '#';
55
}
6-
t += "$";
6+
t += '$';
77

88
const n = t.length;
99
const p: number[] = new Array(n).fill(0);
10-
let pos = 0, maxRight = 0;
10+
let pos = 0,
11+
maxRight = 0;
1112
let ans = 0;
1213

1314
for (let i = 1; i < n - 1; i++) {

solution/0600-0699/0648.Replace Words/Solution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function replaceWords(dictionary: string[], sentence: string): string {
4242
}
4343

4444
return sentence
45-
.split(" ")
45+
.split(' ')
4646
.map(w => trie.search(w))
47-
.join(" ");
47+
.join(' ');
4848
}

solution/0800-0899/0877.Stone Game/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tags:
3333
<pre>
3434
<strong>Input:</strong> piles = [5,3,4,5]
3535
<strong>Output:</strong> true
36-
<strong>Explanation:</strong>
36+
<strong>Explanation:</strong>
3737
Alice starts first, and can only take the first 5 or the last 5.
3838
Say she takes the first 5, so that the row becomes [3, 4, 5].
3939
If Bob takes 3, then the board is [4, 5], and Alice takes 5 to win with 10 points.

solution/2500-2599/2573.Find the String with LCP/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tags:
4848
<pre>
4949
<strong>输入:</strong>lcp = [[4,3,2,1],[3,3,2,1],[2,2,2,1],[1,1,1,1]]
5050
<strong>输出:</strong>"aaaa"
51-
<strong>解释:</strong>lcp 对应只有一个不同字母的任意 4 字母字符串,字典序最小的是 "aaaa" 。
51+
<strong>解释:</strong>lcp 对应只有一个不同字母的任意 4 字母字符串,字典序最小的是 "aaaa" 。
5252
</pre>
5353

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

solution/2500-2599/2573.Find the String with LCP/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ tags:
4747
<pre>
4848
<strong>Input:</strong> lcp = [[4,3,2,1],[3,3,2,1],[2,2,2,1],[1,1,1,1]]
4949
<strong>Output:</strong> &quot;aaaa&quot;
50-
<strong>Explanation:</strong> lcp corresponds to any 4 letter string with a single distinct letter. The lexicographically smallest of them is &quot;aaaa&quot;.
50+
<strong>Explanation:</strong> lcp corresponds to any 4 letter string with a single distinct letter. The lexicographically smallest of them is &quot;aaaa&quot;.
5151
</pre>
5252

5353
<p><strong class="example">Example 3:</strong></p>

solution/2500-2599/2574.Left and Right Sum Differences/Solution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ function leftRightDifference(nums: number[]): number[] {
77
l += x;
88
}
99
return ans;
10-
};
10+
}

0 commit comments

Comments
 (0)