Skip to content

Commit 9c41652

Browse files
author
Shuo
committed
A: new
1 parent 4bd0377 commit 9c41652

File tree

133 files changed

+2764
-1156
lines changed

Some content is hidden

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

133 files changed

+2764
-1156
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,22 @@ LeetCode Problems' Solutions
7070

7171
| # | Title | Solution | Difficulty |
7272
| :-: | - | - | :-: |
73+
| <span id="1612">1612</span> | [Check If Two Expression Trees are Equivalent](https://leetcode.com/problems/check-if-two-expression-trees-are-equivalent) 🔒 | [Go](problems/check-if-two-expression-trees-are-equivalent) | Medium |
74+
| <span id="1611">1611</span> | [Minimum One Bit Operations to Make Integers Zero](https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero "使整数变为 0 的最少操作次数") | [Go](problems/minimum-one-bit-operations-to-make-integers-zero) | Hard |
75+
| <span id="1610">1610</span> | [Maximum Number of Visible Points](https://leetcode.com/problems/maximum-number-of-visible-points "可见点的最大数目") | [Go](problems/maximum-number-of-visible-points) | Hard |
76+
| <span id="1609">1609</span> | [Even Odd Tree](https://leetcode.com/problems/even-odd-tree "奇偶树") | [Go](problems/even-odd-tree) | Medium |
77+
| <span id="1608">1608</span> | [Special Array With X Elements Greater Than or Equal X](https://leetcode.com/problems/special-array-with-x-elements-greater-than-or-equal-x "特殊数组的特征值") | [Go](problems/special-array-with-x-elements-greater-than-or-equal-x) | Easy |
78+
| <span id="1607">1607</span> | [Sellers With No Sales](https://leetcode.com/problems/sellers-with-no-sales) 🔒 | [MySQL](problems/sellers-with-no-sales) | Easy |
79+
| <span id="1606">1606</span> | [Find Servers That Handled Most Number of Requests](https://leetcode.com/problems/find-servers-that-handled-most-number-of-requests "找到处理最多请求的服务器") | [Go](problems/find-servers-that-handled-most-number-of-requests) | Hard |
80+
| <span id="1605">1605</span> | [Find Valid Matrix Given Row and Column Sums](https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums "给定行和列的和求可行矩阵") | [Go](problems/find-valid-matrix-given-row-and-column-sums) | Medium |
81+
| <span id="1604">1604</span> | [Alert Using Same Key-Card Three or More Times in a One Hour Period](https://leetcode.com/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period "警告一小时内使用相同员工卡大于等于三次的人") | [Go](problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period) | Medium |
82+
| <span id="1603">1603</span> | [Design Parking System](https://leetcode.com/problems/design-parking-system "设计停车系统") | [Go](problems/design-parking-system) | Easy |
83+
| <span id="1602">1602</span> | [Find Nearest Right Node in Binary Tree](https://leetcode.com/problems/find-nearest-right-node-in-binary-tree) 🔒 | [Go](problems/find-nearest-right-node-in-binary-tree) | Medium |
7384
| <span id="1601">1601</span> | [Maximum Number of Achievable Transfer Requests](https://leetcode.com/problems/maximum-number-of-achievable-transfer-requests "最多可达成的换楼请求数目") | [Go](problems/maximum-number-of-achievable-transfer-requests) | Hard |
7485
| <span id="1600">1600</span> | [Throne Inheritance](https://leetcode.com/problems/throne-inheritance "皇位继承顺序") | [Go](problems/throne-inheritance) | Medium |
7586
| <span id="1599">1599</span> | [Maximum Profit of Operating a Centennial Wheel](https://leetcode.com/problems/maximum-profit-of-operating-a-centennial-wheel "经营摩天轮的最大利润") | [Go](problems/maximum-profit-of-operating-a-centennial-wheel) | Medium |
7687
| <span id="1598">1598</span> | [Crawler Log Folder](https://leetcode.com/problems/crawler-log-folder "文件夹操作日志搜集器") | [Go](problems/crawler-log-folder) | Easy |
77-
| <span id="1597">1597</span> | [Build Binary Expression Tree From Infix Expression](https://leetcode.com/problems/build-binary-expression-tree-from-infix-expression) 🔒 | [Go](problems/build-binary-expression-tree-from-infix-expression) | Medium |
88+
| <span id="1597">1597</span> | [Build Binary Expression Tree From Infix Expression](https://leetcode.com/problems/build-binary-expression-tree-from-infix-expression "根据中缀表达式构造二叉表达式树") 🔒 | [Go](problems/build-binary-expression-tree-from-infix-expression) | Hard |
7889
| <span id="1596">1596</span> | [The Most Frequently Ordered Products for Each Customer](https://leetcode.com/problems/the-most-frequently-ordered-products-for-each-customer) 🔒 | [MySQL](problems/the-most-frequently-ordered-products-for-each-customer) | Medium |
7990
| <span id="1595">1595</span> | [Minimum Cost to Connect Two Groups of Points](https://leetcode.com/problems/minimum-cost-to-connect-two-groups-of-points "连通两组点的最小成本") | [Go](problems/minimum-cost-to-connect-two-groups-of-points) | Hard |
8091
| <span id="1594">1594</span> | [Maximum Non Negative Product in a Matrix](https://leetcode.com/problems/maximum-non-negative-product-in-a-matrix "矩阵的最大非负积") | [Go](problems/maximum-non-negative-product-in-a-matrix) | Medium |
@@ -90,7 +101,7 @@ LeetCode Problems' Solutions
90101
| <span id="1584">1584</span> | [Min Cost to Connect All Points](https://leetcode.com/problems/min-cost-to-connect-all-points "连接所有点的最小费用") | [Go](problems/min-cost-to-connect-all-points) | Medium |
91102
| <span id="1583">1583</span> | [Count Unhappy Friends](https://leetcode.com/problems/count-unhappy-friends "统计不开心的朋友") | [Go](problems/count-unhappy-friends) | Medium |
92103
| <span id="1582">1582</span> | [Special Positions in a Binary Matrix](https://leetcode.com/problems/special-positions-in-a-binary-matrix "二进制矩阵中的特殊位置") | [Go](problems/special-positions-in-a-binary-matrix) | Easy |
93-
| <span id="1581">1581</span> | [Customer Who Visited but Did Not Make Any Transactions](https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions) 🔒 | [MySQL](problems/customer-who-visited-but-did-not-make-any-transactions) | Easy |
104+
| <span id="1581">1581</span> | [Customer Who Visited but Did Not Make Any Transactions](https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions "进店却未进行过交易的客户") 🔒 | [MySQL](problems/customer-who-visited-but-did-not-make-any-transactions) | Easy |
94105
| <span id="1580">1580</span> | [Put Boxes Into the Warehouse II](https://leetcode.com/problems/put-boxes-into-the-warehouse-ii) 🔒 | [Go](problems/put-boxes-into-the-warehouse-ii) | Medium |
95106
| <span id="1579">1579</span> | [Remove Max Number of Edges to Keep Graph Fully Traversable](https://leetcode.com/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable "保证图可完全遍历") | [Go](problems/remove-max-number-of-edges-to-keep-graph-fully-traversable) | Hard |
96107
| <span id="1578">1578</span> | [Minimum Deletion Cost to Avoid Repeating Letters](https://leetcode.com/problems/minimum-deletion-cost-to-avoid-repeating-letters "避免重复字母的最小删除成本") | [Go](problems/minimum-deletion-cost-to-avoid-repeating-letters) | Medium |
@@ -101,13 +112,13 @@ LeetCode Problems' Solutions
101112
| <span id="1573">1573</span> | [Number of Ways to Split a String](https://leetcode.com/problems/number-of-ways-to-split-a-string "分割字符串的方案数") | [Go](problems/number-of-ways-to-split-a-string) | Medium |
102113
| <span id="1572">1572</span> | [Matrix Diagonal Sum](https://leetcode.com/problems/matrix-diagonal-sum "矩阵对角线元素的和") | [Go](problems/matrix-diagonal-sum) | Easy |
103114
| <span id="1571">1571</span> | [Warehouse Manager](https://leetcode.com/problems/warehouse-manager "仓库经理") 🔒 | [MySQL](problems/warehouse-manager) | Easy |
104-
| <span id="1570">1570</span> | [Dot Product of Two Sparse Vectors](https://leetcode.com/problems/dot-product-of-two-sparse-vectors) 🔒 | [Go](problems/dot-product-of-two-sparse-vectors) | Medium |
115+
| <span id="1570">1570</span> | [Dot Product of Two Sparse Vectors](https://leetcode.com/problems/dot-product-of-two-sparse-vectors "两个稀疏向量的点积") 🔒 | [Go](problems/dot-product-of-two-sparse-vectors) | Medium |
105116
| <span id="1569">1569</span> | [Number of Ways to Reorder Array to Get Same BST](https://leetcode.com/problems/number-of-ways-to-reorder-array-to-get-same-bst "将子数组重新排序得到同一个二叉查找树的方案数") | [Go](problems/number-of-ways-to-reorder-array-to-get-same-bst) | Hard |
106117
| <span id="1568">1568</span> | [Minimum Number of Days to Disconnect Island](https://leetcode.com/problems/minimum-number-of-days-to-disconnect-island "使陆地分离的最少天数") | [Go](problems/minimum-number-of-days-to-disconnect-island) | Hard |
107118
| <span id="1567">1567</span> | [Maximum Length of Subarray With Positive Product](https://leetcode.com/problems/maximum-length-of-subarray-with-positive-product "乘积为正数的最长子数组长度") | [Go](problems/maximum-length-of-subarray-with-positive-product) | Medium |
108119
| <span id="1566">1566</span> | [Detect Pattern of Length M Repeated K or More Times](https://leetcode.com/problems/detect-pattern-of-length-m-repeated-k-or-more-times "重复至少 K 次且长度为 M 的模式") | [Go](problems/detect-pattern-of-length-m-repeated-k-or-more-times) | Easy |
109-
| <span id="1565">1565</span> | [Unique Orders and Customers Per Month](https://leetcode.com/problems/unique-orders-and-customers-per-month) 🔒 | [MySQL](problems/unique-orders-and-customers-per-month) | Easy |
110-
| <span id="1564">1564</span> | [Put Boxes Into the Warehouse I](https://leetcode.com/problems/put-boxes-into-the-warehouse-i) 🔒 | [Go](problems/put-boxes-into-the-warehouse-i) | Medium |
120+
| <span id="1565">1565</span> | [Unique Orders and Customers Per Month](https://leetcode.com/problems/unique-orders-and-customers-per-month "按月统计订单数与顾客数") 🔒 | [MySQL](problems/unique-orders-and-customers-per-month) | Easy |
121+
| <span id="1564">1564</span> | [Put Boxes Into the Warehouse I](https://leetcode.com/problems/put-boxes-into-the-warehouse-i "把箱子放进仓库里 I") 🔒 | [Go](problems/put-boxes-into-the-warehouse-i) | Medium |
111122
| <span id="1563">1563</span> | [Stone Game V](https://leetcode.com/problems/stone-game-v "石子游戏 V") | [Go](problems/stone-game-v) | Hard |
112123
| <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 |
113124
| <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 |
@@ -123,7 +134,7 @@ LeetCode Problems' Solutions
123134
| <span id="1551">1551</span> | [Minimum Operations to Make Array Equal](https://leetcode.com/problems/minimum-operations-to-make-array-equal "使数组中所有元素相等的最小操作数") | [Go](problems/minimum-operations-to-make-array-equal) | Medium |
124135
| <span id="1550">1550</span> | [Three Consecutive Odds](https://leetcode.com/problems/three-consecutive-odds "存在连续三个奇数的数组") | [Go](problems/three-consecutive-odds) | Easy |
125136
| <span id="1549">1549</span> | [The Most Recent Orders for Each Product](https://leetcode.com/problems/the-most-recent-orders-for-each-product "每件商品的最新订单") 🔒 | [MySQL](problems/the-most-recent-orders-for-each-product) | Medium |
126-
| <span id="1548">1548</span> | [The Most Similar Path in a Graph](https://leetcode.com/problems/the-most-similar-path-in-a-graph) 🔒 | [Go](problems/the-most-similar-path-in-a-graph) | Hard |
137+
| <span id="1548">1548</span> | [The Most Similar Path in a Graph](https://leetcode.com/problems/the-most-similar-path-in-a-graph "图中最相似的路径") 🔒 | [Go](problems/the-most-similar-path-in-a-graph) | Hard |
127138
| <span id="1547">1547</span> | [Minimum Cost to Cut a Stick](https://leetcode.com/problems/minimum-cost-to-cut-a-stick "切棍子的最小成本") | [Go](problems/minimum-cost-to-cut-a-stick) | Hard |
128139
| <span id="1546">1546</span> | [Maximum Number of Non-Overlapping Subarrays With Sum Equals Target](https://leetcode.com/problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target "和为目标值的最大数目不重叠非空子数组数目") | [Go](problems/maximum-number-of-non-overlapping-subarrays-with-sum-equals-target) | Medium |
129140
| <span id="1545">1545</span> | [Find Kth Bit in Nth Binary String](https://leetcode.com/problems/find-kth-bit-in-nth-binary-string "找出第 N 个二进制字符串中的第 K 位") | [Go](problems/find-kth-bit-in-nth-binary-string) | Medium |
@@ -217,7 +228,7 @@ LeetCode Problems' Solutions
217228
| <span id="1457">1457</span> | [Pseudo-Palindromic Paths in a Binary Tree](https://leetcode.com/problems/pseudo-palindromic-paths-in-a-binary-tree "二叉树中的伪回文路径") | [Go](problems/pseudo-palindromic-paths-in-a-binary-tree) | Medium |
218229
| <span id="1456">1456</span> | [Maximum Number of Vowels in a Substring of Given Length](https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length "定长子串中元音的最大数目") | [Go](problems/maximum-number-of-vowels-in-a-substring-of-given-length) | Medium |
219230
| <span id="1455">1455</span> | [Check If a Word Occurs As a Prefix of Any Word in a Sentence](https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence "检查单词是否为句中其他单词的前缀") | [Go](problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence) | Easy |
220-
| <span id="1454">1454</span> | [Active Users](https://leetcode.com/problems/active-users " 活跃用户") 🔒 | [MySQL](problems/active-users) | Medium |
231+
| <span id="1454">1454</span> | [Active Users](https://leetcode.com/problems/active-users "活跃用户") 🔒 | [MySQL](problems/active-users) | Medium |
221232
| <span id="1453">1453</span> | [Maximum Number of Darts Inside of a Circular Dartboard](https://leetcode.com/problems/maximum-number-of-darts-inside-of-a-circular-dartboard "圆形靶内的最大飞镖数量") | [Go](problems/maximum-number-of-darts-inside-of-a-circular-dartboard) | Hard |
222233
| <span id="1452">1452</span> | [People Whose List of Favorite Companies Is Not a Subset of Another List](https://leetcode.com/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list "收藏清单") | [Go](problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list) | Medium |
223234
| <span id="1451">1451</span> | [Rearrange Words in a Sentence](https://leetcode.com/problems/rearrange-words-in-a-sentence "重新排列句子中的单词") | [Go](problems/rearrange-words-in-a-sentence) | Medium |

problems/4sum/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@
1313

1414
<p>Given an array <code>nums</code> of <em>n</em> integers and an integer <code>target</code>, are there elements <em>a</em>, <em>b</em>, <em>c</em>, and <em>d</em> in <code>nums</code> such that <em>a</em> + <em>b</em> + <em>c</em> + <em>d</em> = <code>target</code>? Find all unique quadruplets in the array which gives the sum of <code>target</code>.</p>
1515

16-
<p><strong>Note:</strong></p>
17-
18-
<p>The solution set must not contain duplicate quadruplets.</p>
19-
20-
<p><strong>Example:</strong></p>
21-
22-
<pre>
23-
Given array nums = [1, 0, -1, 0, -2, 2], and target = 0.
24-
25-
A solution set is:
26-
[
27-
[-1, 0, 0, 1],
28-
[-2, -1, 1, 2],
29-
[-2, 0, 0, 2]
30-
]
16+
<p><strong>Notice</strong>&nbsp;that&nbsp;the solution set must not contain duplicate quadruplets.</p>
17+
18+
<p>&nbsp;</p>
19+
<p><strong>Example 1:</strong></p>
20+
<pre><strong>Input:</strong> nums = [1,0,-1,0,-2,2], target = 0
21+
<strong>Output:</strong> [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]
22+
</pre><p><strong>Example 2:</strong></p>
23+
<pre><strong>Input:</strong> nums = [], target = 0
24+
<strong>Output:</strong> []
3125
</pre>
26+
<p>&nbsp;</p>
27+
<p><strong>Constraints:</strong></p>
28+
29+
<ul>
30+
<li><code>0 &lt;= nums.length &lt;= 200</code></li>
31+
<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
32+
<li><code>-10<sup>9</sup> &lt;= target &lt;= 10<sup>9</sup></code></li>
33+
</ul>
3234

3335
### Related Topics
3436
[[Array](../../tag/array/README.md)]

problems/active-users/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
[Next >](../check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence "Check If a Word Occurs As a Prefix of Any Word in a Sentence")
1111

12-
## [1454. Active Users (Medium)](https://leetcode.com/problems/active-users " 活跃用户")
12+
## [1454. Active Users (Medium)](https://leetcode.com/problems/active-users "活跃用户")
1313

1414

problems/add-two-numbers/README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,42 @@
1111

1212
## [2. Add Two Numbers (Medium)](https://leetcode.com/problems/add-two-numbers "两数相加")
1313

14-
<p>You are given two <b>non-empty</b> linked lists representing two non-negative integers. The digits are stored in <b>reverse order</b> and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.</p>
14+
<p>You are given two <b>non-empty</b> linked lists representing two non-negative integers. The digits are stored in <b>reverse order</b>, and each of their nodes contains a single digit. Add the two numbers and return the sum&nbsp;as a linked list.</p>
1515

1616
<p>You may assume the two numbers do not contain any leading zero, except the number 0 itself.</p>
1717

18-
<p><b>Example:</b></p>
18+
<p>&nbsp;</p>
19+
<p><strong>Example 1:</strong></p>
20+
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/02/addtwonumber1.jpg" style="width: 483px; height: 342px;" />
21+
<pre>
22+
<strong>Input:</strong> l1 = [2,4,3], l2 = [5,6,4]
23+
<strong>Output:</strong> [7,0,8]
24+
<strong>Explanation:</strong> 342 + 465 = 807.
25+
</pre>
26+
27+
<p><strong>Example 2:</strong></p>
1928

2029
<pre>
21-
<b>Input:</b> (2 -&gt; 4 -&gt; 3) + (5 -&gt; 6 -&gt; 4)
22-
<b>Output:</b> 7 -&gt; 0 -&gt; 8
23-
<b>Explanation:</b> 342 + 465 = 807.
30+
<strong>Input:</strong> l1 = [0], l2 = [0]
31+
<strong>Output:</strong> [0]
2432
</pre>
2533

34+
<p><strong>Example 3:</strong></p>
35+
36+
<pre>
37+
<strong>Input:</strong> l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
38+
<strong>Output:</strong> [8,9,9,9,0,0,0,1]
39+
</pre>
40+
41+
<p>&nbsp;</p>
42+
<p><strong>Constraints:</strong></p>
43+
44+
<ul>
45+
<li>The number of nodes in each linked list is in the range <code>[1, 100]</code>.</li>
46+
<li><code>0 &lt;= Node.val &lt;= 9</code></li>
47+
<li>It is guaranteed that the list represents a number that does not have leading zeros.</li>
48+
</ul>
49+
2650
### Related Topics
2751
[[Linked List](../../tag/linked-list/README.md)]
2852
[[Math](../../tag/math/README.md)]

0 commit comments

Comments
 (0)