Skip to content

Commit 7c54dc6

Browse files
author
Shuo
committed
A: new
1 parent a7e7771 commit 7c54dc6

File tree

290 files changed

+3890
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+3890
-533
lines changed

README.md

+43-2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,47 @@ LeetCode Problems' Solutions
7878

7979
| # | Title | Solution | Difficulty |
8080
| :-: | - | - | :-: |
81+
| <span id="2045">2045</span> | [Second Minimum Time to Reach Destination](https://leetcode.com/problems/second-minimum-time-to-reach-destination "到达目的地的第二短时间") | [Go](problems/second-minimum-time-to-reach-destination) | Hard |
82+
| <span id="2044">2044</span> | [Count Number of Maximum Bitwise-OR Subsets](https://leetcode.com/problems/count-number-of-maximum-bitwise-or-subsets "统计按位或能得到最大值的子集数目") | [Go](problems/count-number-of-maximum-bitwise-or-subsets) | Medium |
83+
| <span id="2043">2043</span> | [Simple Bank System](https://leetcode.com/problems/simple-bank-system "简易银行系统") | [Go](problems/simple-bank-system) | Medium |
84+
| <span id="2042">2042</span> | [Check if Numbers Are Ascending in a Sentence](https://leetcode.com/problems/check-if-numbers-are-ascending-in-a-sentence "检查句子中的数字是否递增") | [Go](problems/check-if-numbers-are-ascending-in-a-sentence) | Easy |
85+
| <span id="2041">2041</span> | [Accepted Candidates From the Interviews](https://leetcode.com/problems/accepted-candidates-from-the-interviews) 🔒 | [MySQL](problems/accepted-candidates-from-the-interviews) | Medium |
86+
| <span id="2040">2040</span> | [Kth Smallest Product of Two Sorted Arrays](https://leetcode.com/problems/kth-smallest-product-of-two-sorted-arrays "两个有序数组的第 K 小乘积") | [Go](problems/kth-smallest-product-of-two-sorted-arrays) | Hard |
87+
| <span id="2039">2039</span> | [The Time When the Network Becomes Idle](https://leetcode.com/problems/the-time-when-the-network-becomes-idle "网络空闲的时刻") | [Go](problems/the-time-when-the-network-becomes-idle) | Medium |
88+
| <span id="2038">2038</span> | [Remove Colored Pieces if Both Neighbors are the Same Color](https://leetcode.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color "如果相邻两个颜色均相同则删除当前颜色") | [Go](problems/remove-colored-pieces-if-both-neighbors-are-the-same-color) | Medium |
89+
| <span id="2037">2037</span> | [Minimum Number of Moves to Seat Everyone](https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone "使每位学生都有座位的最少移动次数") | [Go](problems/minimum-number-of-moves-to-seat-everyone) | Easy |
90+
| <span id="2036">2036</span> | [Maximum Alternating Subarray Sum](https://leetcode.com/problems/maximum-alternating-subarray-sum) 🔒 | [Go](problems/maximum-alternating-subarray-sum) | Medium |
91+
| <span id="2035">2035</span> | [Partition Array Into Two Arrays to Minimize Sum Difference](https://leetcode.com/problems/partition-array-into-two-arrays-to-minimize-sum-difference "将数组分成两个数组并最小化数组和的差") | [Go](problems/partition-array-into-two-arrays-to-minimize-sum-difference) | Hard |
92+
| <span id="2034">2034</span> | [Stock Price Fluctuation](https://leetcode.com/problems/stock-price-fluctuation "股票价格波动") | [Go](problems/stock-price-fluctuation) | Medium |
93+
| <span id="2033">2033</span> | [Minimum Operations to Make a Uni-Value Grid](https://leetcode.com/problems/minimum-operations-to-make-a-uni-value-grid "获取单值网格的最小操作数") | [Go](problems/minimum-operations-to-make-a-uni-value-grid) | Medium |
94+
| <span id="2032">2032</span> | [Two Out of Three](https://leetcode.com/problems/two-out-of-three "至少在两个数组中出现的值") | [Go](problems/two-out-of-three) | Easy |
95+
| <span id="2031">2031</span> | [Count Subarrays With More Ones Than Zeros](https://leetcode.com/problems/count-subarrays-with-more-ones-than-zeros) 🔒 | [Go](problems/count-subarrays-with-more-ones-than-zeros) | Medium |
96+
| <span id="2030">2030</span> | [Smallest K-Length Subsequence With Occurrences of a Letter](https://leetcode.com/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter "含特定字母的最小子序列") | [Go](problems/smallest-k-length-subsequence-with-occurrences-of-a-letter) | Hard |
97+
| <span id="2029">2029</span> | [Stone Game IX](https://leetcode.com/problems/stone-game-ix "石子游戏 IX") | [Go](problems/stone-game-ix) | Medium |
98+
| <span id="2028">2028</span> | [Find Missing Observations](https://leetcode.com/problems/find-missing-observations "找出缺失的观测数据") | [Go](problems/find-missing-observations) | Medium |
99+
| <span id="2027">2027</span> | [Minimum Moves to Convert String](https://leetcode.com/problems/minimum-moves-to-convert-string "转换字符串的最少操作次数") | [Go](problems/minimum-moves-to-convert-string) | Easy |
100+
| <span id="2026">2026</span> | [Low-Quality Problems](https://leetcode.com/problems/low-quality-problems) 🔒 | [MySQL](problems/low-quality-problems) | Easy |
101+
| <span id="2025">2025</span> | [Maximum Number of Ways to Partition an Array](https://leetcode.com/problems/maximum-number-of-ways-to-partition-an-array "分割数组的最多方案数") | [Go](problems/maximum-number-of-ways-to-partition-an-array) | Hard |
102+
| <span id="2024">2024</span> | [Maximize the Confusion of an Exam](https://leetcode.com/problems/maximize-the-confusion-of-an-exam "考试的最大困扰度") | [Go](problems/maximize-the-confusion-of-an-exam) | Medium |
103+
| <span id="2023">2023</span> | [Number of Pairs of Strings With Concatenation Equal to Target](https://leetcode.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target "连接后等于目标字符串的字符串对") | [Go](problems/number-of-pairs-of-strings-with-concatenation-equal-to-target) | Medium |
104+
| <span id="2022">2022</span> | [Convert 1D Array Into 2D Array](https://leetcode.com/problems/convert-1d-array-into-2d-array "将一维数组转变成二维数组") | [Go](problems/convert-1d-array-into-2d-array) | Easy |
105+
| <span id="2021">2021</span> | [Brightest Position on Street](https://leetcode.com/problems/brightest-position-on-street) 🔒 | [Go](problems/brightest-position-on-street) | Medium |
106+
| <span id="2020">2020</span> | [Number of Accounts That Did Not Stream](https://leetcode.com/problems/number-of-accounts-that-did-not-stream) 🔒 | [MySQL](problems/number-of-accounts-that-did-not-stream) | Medium |
107+
| <span id="2019">2019</span> | [The Score of Students Solving Math Expression](https://leetcode.com/problems/the-score-of-students-solving-math-expression "解出数学表达式的学生分数") | [Go](problems/the-score-of-students-solving-math-expression) | Hard |
108+
| <span id="2018">2018</span> | [Check if Word Can Be Placed In Crossword](https://leetcode.com/problems/check-if-word-can-be-placed-in-crossword "判断单词是否能放入填字游戏内") | [Go](problems/check-if-word-can-be-placed-in-crossword) | Medium |
109+
| <span id="2017">2017</span> | [Grid Game](https://leetcode.com/problems/grid-game "网格游戏") | [Go](problems/grid-game) | Medium |
110+
| <span id="2016">2016</span> | [Maximum Difference Between Increasing Elements](https://leetcode.com/problems/maximum-difference-between-increasing-elements "增量元素之间的最大差值") | [Go](problems/maximum-difference-between-increasing-elements) | Easy |
111+
| <span id="2015">2015</span> | [Average Height of Buildings in Each Segment](https://leetcode.com/problems/average-height-of-buildings-in-each-segment) 🔒 | [Go](problems/average-height-of-buildings-in-each-segment) | Medium |
112+
| <span id="2014">2014</span> | [Longest Subsequence Repeated k Times](https://leetcode.com/problems/longest-subsequence-repeated-k-times "重复 K 次的最长子序列") | [Go](problems/longest-subsequence-repeated-k-times) | Hard |
113+
| <span id="2013">2013</span> | [Detect Squares](https://leetcode.com/problems/detect-squares "检测正方形") | [Go](problems/detect-squares) | Medium |
114+
| <span id="2012">2012</span> | [Sum of Beauty in the Array](https://leetcode.com/problems/sum-of-beauty-in-the-array "数组美丽值求和") | [Go](problems/sum-of-beauty-in-the-array) | Medium |
115+
| <span id="2011">2011</span> | [Final Value of Variable After Performing Operations](https://leetcode.com/problems/final-value-of-variable-after-performing-operations "执行操作后的变量值") | [Go](problems/final-value-of-variable-after-performing-operations) | Easy |
116+
| <span id="2010">2010</span> | [The Number of Seniors and Juniors to Join the Company II](https://leetcode.com/problems/the-number-of-seniors-and-juniors-to-join-the-company-ii) 🔒 | [MySQL](problems/the-number-of-seniors-and-juniors-to-join-the-company-ii) | Hard |
117+
| <span id="2009">2009</span> | [Minimum Number of Operations to Make Array Continuous](https://leetcode.com/problems/minimum-number-of-operations-to-make-array-continuous "使数组连续的最少操作数") | [Go](problems/minimum-number-of-operations-to-make-array-continuous) | Hard |
118+
| <span id="2008">2008</span> | [Maximum Earnings From Taxi](https://leetcode.com/problems/maximum-earnings-from-taxi "出租车的最大盈利") | [Go](problems/maximum-earnings-from-taxi) | Medium |
119+
| <span id="2007">2007</span> | [Find Original Array From Doubled Array](https://leetcode.com/problems/find-original-array-from-doubled-array "从双倍数组中还原原数组") | [Go](problems/find-original-array-from-doubled-array) | Medium |
120+
| <span id="2006">2006</span> | [Count Number of Pairs With Absolute Difference K](https://leetcode.com/problems/count-number-of-pairs-with-absolute-difference-k "差的绝对值为 K 的数对数目") | [Go](problems/count-number-of-pairs-with-absolute-difference-k) | Easy |
121+
| <span id="2005">2005</span> | [Subtree Removal Game with Fibonacci Tree](https://leetcode.com/problems/subtree-removal-game-with-fibonacci-tree) 🔒 | [Go](problems/subtree-removal-game-with-fibonacci-tree) | Hard |
81122
| <span id="2004">2004</span> | [The Number of Seniors and Juniors to Join the Company](https://leetcode.com/problems/the-number-of-seniors-and-juniors-to-join-the-company) 🔒 | [MySQL](problems/the-number-of-seniors-and-juniors-to-join-the-company) | Hard |
82123
| <span id="2003">2003</span> | [Smallest Missing Genetic Value in Each Subtree](https://leetcode.com/problems/smallest-missing-genetic-value-in-each-subtree "每棵子树内缺失的最小基因值") | [Go](problems/smallest-missing-genetic-value-in-each-subtree) | Hard |
83124
| <span id="2002">2002</span> | [Maximum Product of the Length of Two Palindromic Subsequences](https://leetcode.com/problems/maximum-product-of-the-length-of-two-palindromic-subsequences "两个回文子序列长度的最大乘积") | [Go](problems/maximum-product-of-the-length-of-two-palindromic-subsequences) | Medium |
@@ -164,7 +205,7 @@ LeetCode Problems' Solutions
164205
| <span id="1921">1921</span> | [Eliminate Maximum Number of Monsters](https://leetcode.com/problems/eliminate-maximum-number-of-monsters "消灭怪物的最大数量") | [Go](problems/eliminate-maximum-number-of-monsters) | Medium |
165206
| <span id="1920">1920</span> | [Build Array from Permutation](https://leetcode.com/problems/build-array-from-permutation "基于排列构建数组") | [Go](problems/build-array-from-permutation) | Easy |
166207
| <span id="1919">1919</span> | [Leetcodify Similar Friends](https://leetcode.com/problems/leetcodify-similar-friends "兴趣相同的朋友") 🔒 | [MySQL](problems/leetcodify-similar-friends) | Hard |
167-
| <span id="1918">1918</span> | [Kth Smallest Subarray Sum](https://leetcode.com/problems/kth-smallest-subarray-sum "第 K 小的子序列和") 🔒 | [Go](problems/kth-smallest-subarray-sum) | Medium |
208+
| <span id="1918">1918</span> | [Kth Smallest Subarray Sum](https://leetcode.com/problems/kth-smallest-subarray-sum "第 K 小的子数组和·") 🔒 | [Go](problems/kth-smallest-subarray-sum) | Medium |
168209
| <span id="1917">1917</span> | [Leetcodify Friends Recommendations](https://leetcode.com/problems/leetcodify-friends-recommendations) 🔒 | [MySQL](problems/leetcodify-friends-recommendations) | Hard |
169210
| <span id="1916">1916</span> | [Count Ways to Build Rooms in an Ant Colony](https://leetcode.com/problems/count-ways-to-build-rooms-in-an-ant-colony "统计为蚁群构筑房间的不同顺序") | [Go](problems/count-ways-to-build-rooms-in-an-ant-colony) | Hard |
170211
| <span id="1915">1915</span> | [Number of Wonderful Substrings](https://leetcode.com/problems/number-of-wonderful-substrings "最美子字符串的数目") | [Go](problems/number-of-wonderful-substrings) | Medium |
@@ -523,7 +564,7 @@ LeetCode Problems' Solutions
523564
| <span id="1562">1562</span> | [Find Latest Group of Size M](https://leetcode.com/problems/find-latest-group-of-size-m "查找大小为 M 的最新分组") | [Go](problems/find-latest-group-of-size-m) | Medium |
524565
| <span id="1561">1561</span> | [Maximum Number of Coins You Can Get](https://leetcode.com/problems/maximum-number-of-coins-you-can-get "你可以获得的最大硬币数目") | [Go](problems/maximum-number-of-coins-you-can-get) | Medium |
525566
| <span id="1560">1560</span> | [Most Visited Sector in a Circular Track](https://leetcode.com/problems/most-visited-sector-in-a-circular-track "圆形赛道上经过次数最多的扇区") | [Go](problems/most-visited-sector-in-a-circular-track) | Easy |
526-
| <span id="1559">1559</span> | [Detect Cycles in 2D Grid](https://leetcode.com/problems/detect-cycles-in-2d-grid "二维网格图中探测环") | [Go](problems/detect-cycles-in-2d-grid) | Hard |
567+
| <span id="1559">1559</span> | [Detect Cycles in 2D Grid](https://leetcode.com/problems/detect-cycles-in-2d-grid "二维网格图中探测环") | [Go](problems/detect-cycles-in-2d-grid) | Medium |
527568
| <span id="1558">1558</span> | [Minimum Numbers of Function Calls to Make Target Array](https://leetcode.com/problems/minimum-numbers-of-function-calls-to-make-target-array "得到目标数组的最少函数调用次数") | [Go](problems/minimum-numbers-of-function-calls-to-make-target-array) | Medium |
528569
| <span id="1557">1557</span> | [Minimum Number of Vertices to Reach All Nodes](https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes "可以到达所有点的最少点数目") | [Go](problems/minimum-number-of-vertices-to-reach-all-nodes) | Medium |
529570
| <span id="1556">1556</span> | [Thousand Separator](https://leetcode.com/problems/thousand-separator "千位分隔数") | [Go](problems/thousand-separator) | Easy |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author openset <[email protected]> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
7+
8+
[< Previous](../kth-smallest-product-of-two-sorted-arrays "Kth Smallest Product of Two Sorted Arrays")
9+
                
10+
[Next >](../check-if-numbers-are-ascending-in-a-sentence "Check if Numbers Are Ascending in a Sentence")
11+
12+
## [2041. Accepted Candidates From the Interviews (Medium)](https://leetcode.com/problems/accepted-candidates-from-the-interviews "")
13+
14+
15+
16+
### Related Topics
17+
[[Database](../../tag/database/README.md)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Create table If Not Exists Candidates (candidate_id int, name varchar(30), years_of_exp int, interview_id int);
2+
Create table If Not Exists Rounds (interview_id int, round_id int, score int);
3+
Truncate table Candidates;
4+
insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('11', 'Atticus', '1', '101');
5+
insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('9', 'Ruben', '6', '104');
6+
insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('6', 'Aliza', '10', '109');
7+
insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('8', 'Alfredo', '0', '107');
8+
Truncate table Rounds;
9+
insert into Rounds (interview_id, round_id, score) values ('109', '3', '4');
10+
insert into Rounds (interview_id, round_id, score) values ('101', '2', '8');
11+
insert into Rounds (interview_id, round_id, score) values ('109', '4', '1');
12+
insert into Rounds (interview_id, round_id, score) values ('107', '1', '3');
13+
insert into Rounds (interview_id, round_id, score) values ('104', '3', '6');
14+
insert into Rounds (interview_id, round_id, score) values ('109', '1', '4');
15+
insert into Rounds (interview_id, round_id, score) values ('104', '4', '7');
16+
insert into Rounds (interview_id, round_id, score) values ('104', '1', '2');
17+
insert into Rounds (interview_id, round_id, score) values ('109', '2', '1');
18+
insert into Rounds (interview_id, round_id, score) values ('104', '2', '7');
19+
insert into Rounds (interview_id, round_id, score) values ('107', '2', '3');
20+
insert into Rounds (interview_id, round_id, score) values ('101', '1', '8');

problems/add-digits/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ Since 2 has only one digit, return it.
4444

4545
### Related Topics
4646
[[Math](../../tag/math/README.md)]
47-
[[Number Theory](../../tag/number-theory/README.md)]
4847
[[Simulation](../../tag/simulation/README.md)]
48+
[[Number Theory](../../tag/number-theory/README.md)]
4949

5050
### Similar Questions
5151
1. [Happy Number](../happy-number) (Easy)
5252
1. [Sum of Digits in the Minimum Number](../sum-of-digits-in-the-minimum-number) (Easy)
53+
1. [Sum of Digits of String After Convert](../sum-of-digits-of-string-after-convert) (Easy)
5354

5455
### Hints
5556
<details>

problems/advantage-shuffle/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
</ul>
3434

3535
### Related Topics
36-
[[Greedy](../../tag/greedy/README.md)]
3736
[[Array](../../tag/array/README.md)]
37+
[[Greedy](../../tag/greedy/README.md)]
3838
[[Sorting](../../tag/sorting/README.md)]

problems/all-elements-in-two-binary-search-trees/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
[[Tree](../../tag/tree/README.md)]
6464
[[Depth-First Search](../../tag/depth-first-search/README.md)]
6565
[[Binary Search Tree](../../tag/binary-search-tree/README.md)]
66-
[[Binary Tree](../../tag/binary-tree/README.md)]
6766
[[Sorting](../../tag/sorting/README.md)]
67+
[[Binary Tree](../../tag/binary-tree/README.md)]
6868

6969
### Hints
7070
<details>

problems/apply-discount-every-n-orders/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ cashier.getBill([2,3,5],[5,3,2]); // return 2500.0. 6<sup>th
7171
</ul>
7272

7373
### Related Topics
74-
[[Design](../../tag/design/README.md)]
7574
[[Array](../../tag/array/README.md)]
7675
[[Hash Table](../../tag/hash-table/README.md)]
76+
[[Design](../../tag/design/README.md)]
7777

7878
### Hints
7979
<details>

problems/arithmetic-subarrays/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ In the 2<sup>nd</sup> query, the subarray is <code>[5,9,3,7]. This</code> can be
6464
[[Array](../../tag/array/README.md)]
6565
[[Sorting](../../tag/sorting/README.md)]
6666

67-
### Similar Questions
68-
1. [Arithmetic Slices](../arithmetic-slices) (Medium)
69-
1. [Can Make Arithmetic Progression From Sequence](../can-make-arithmetic-progression-from-sequence) (Easy)
70-
7167
### Hints
7268
<details>
7369
<summary>Hint 1</summary>

problems/array-of-doubled-pairs/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@
5353
</ul>
5454

5555
### Related Topics
56-
[[Greedy](../../tag/greedy/README.md)]
5756
[[Array](../../tag/array/README.md)]
5857
[[Hash Table](../../tag/hash-table/README.md)]
58+
[[Greedy](../../tag/greedy/README.md)]
5959
[[Sorting](../../tag/sorting/README.md)]
60+
61+
### Similar Questions
62+
1. [Find Original Array From Doubled Array](../find-original-array-from-doubled-array) (Medium)

0 commit comments

Comments
 (0)