Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a0dbe9a

Browse files
author
Shuo
committed
A: new
1 parent 2e91167 commit a0dbe9a

File tree

37 files changed

+460
-53
lines changed

37 files changed

+460
-53
lines changed

‎README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,23 @@ LeetCode Problems' Solutions
6262

6363
| # | Title | Solution | Difficulty |
6464
| :-: | - | - | :-: |
65+
| <span id="1495">1495</span> | [Friendly Movies Streamed Last Month](https://leetcode.com/problems/friendly-movies-streamed-last-month) 🔒 | [MySQL](problems/friendly-movies-streamed-last-month) | Easy |
66+
| <span id="1494">1494</span> | [Parallel Courses II](https://leetcode.com/problems/parallel-courses-ii "并行课程 II") | [Go](problems/parallel-courses-ii) | Hard |
67+
| <span id="1493">1493</span> | [Longest Subarray of 1's After Deleting One Element](https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element "删掉一个元素以后全为 1 的最长子数组") | [Go](problems/longest-subarray-of-1s-after-deleting-one-element) | Medium |
68+
| <span id="1492">1492</span> | [The kth Factor of n](https://leetcode.com/problems/the-kth-factor-of-n "n 的第 k 个因子") | [Go](problems/the-kth-factor-of-n) | Medium |
69+
| <span id="1491">1491</span> | [Average Salary Excluding the Minimum and Maximum Salary](https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary "去掉最低工资和最高工资后的工资平均值") | [Go](problems/average-salary-excluding-the-minimum-and-maximum-salary) | Easy |
70+
| <span id="1490">1490</span> | [Clone N-ary Tree](https://leetcode.com/problems/clone-n-ary-tree "克隆 N 叉树") 🔒 | [Go](problems/clone-n-ary-tree) | Medium |
6571
| <span id="1489">1489</span> | [Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree](https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "找到最小生成树里的关键边和伪关键边") | [Go](problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree) | Hard |
6672
| <span id="1488">1488</span> | [Avoid Flood in The City](https://leetcode.com/problems/avoid-flood-in-the-city "避免洪水泛滥") | [Go](problems/avoid-flood-in-the-city) | Medium |
6773
| <span id="1487">1487</span> | [Making File Names Unique](https://leetcode.com/problems/making-file-names-unique "保证文件名唯一") | [Go](problems/making-file-names-unique) | Medium |
6874
| <span id="1486">1486</span> | [XOR Operation in an Array](https://leetcode.com/problems/xor-operation-in-an-array "数组异或操作") | [Go](problems/xor-operation-in-an-array) | Easy |
6975
| <span id="1485">1485</span> | [Clone Binary Tree With Random Pointer](https://leetcode.com/problems/clone-binary-tree-with-random-pointer "克隆含随机指针的二叉树") 🔒 | [Go](problems/clone-binary-tree-with-random-pointer) | Medium |
70-
| <span id="1484">1484</span> | [Group Sold Products By The Date](https://leetcode.com/problems/group-sold-products-by-the-date) 🔒 | [MySQL](problems/group-sold-products-by-the-date) | Easy |
76+
| <span id="1484">1484</span> | [Group Sold Products By The Date](https://leetcode.com/problems/group-sold-products-by-the-date"按日期分组销售产品") 🔒 | [MySQL](problems/group-sold-products-by-the-date) | Easy |
7177
| <span id="1483">1483</span> | [Kth Ancestor of a Tree Node](https://leetcode.com/problems/kth-ancestor-of-a-tree-node "树节点的第 K 个祖先") | [Go](problems/kth-ancestor-of-a-tree-node) | Hard |
7278
| <span id="1482">1482</span> | [Minimum Number of Days to Make m Bouquets](https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets "制作 m 束花所需的最少天数") | [Go](problems/minimum-number-of-days-to-make-m-bouquets) | Medium |
7379
| <span id="1481">1481</span> | [Least Number of Unique Integers after K Removals](https://leetcode.com/problems/least-number-of-unique-integers-after-k-removals "不同整数的最少数目") | [Go](problems/least-number-of-unique-integers-after-k-removals) | Medium |
7480
| <span id="1480">1480</span> | [Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array "一维数组的动态和") | [Go](problems/running-sum-of-1d-array) | Easy |
75-
| <span id="1479">1479</span> | [Sales by Day of the Week](https://leetcode.com/problems/sales-by-day-of-the-week) 🔒 | [MySQL](problems/sales-by-day-of-the-week) | Hard |
81+
| <span id="1479">1479</span> | [Sales by Day of the Week](https://leetcode.com/problems/sales-by-day-of-the-week"周内每天的销售情况") 🔒 | [MySQL](problems/sales-by-day-of-the-week) | Hard |
7682
| <span id="1478">1478</span> | [Allocate Mailboxes](https://leetcode.com/problems/allocate-mailboxes "安排邮筒") | [Go](problems/allocate-mailboxes) | Hard |
7783
| <span id="1477">1477</span> | [Find Two Non-overlapping Sub-arrays Each With Target Sum](https://leetcode.com/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum "找两个和为目标值且不重叠的子数组") | [Go](problems/find-two-non-overlapping-sub-arrays-each-with-target-sum) | Medium |
7884
| <span id="1476">1476</span> | [Subrectangle Queries](https://leetcode.com/problems/subrectangle-queries "子矩形查询") | [Go](problems/subrectangle-queries) | Medium |
@@ -82,7 +88,7 @@ LeetCode Problems' Solutions
8288
| <span id="1472">1472</span> | [Design Browser History](https://leetcode.com/problems/design-browser-history "设计浏览器历史记录") | [Go](problems/design-browser-history) | Medium |
8389
| <span id="1471">1471</span> | [The k Strongest Values in an Array](https://leetcode.com/problems/the-k-strongest-values-in-an-array "数组中的 k 个最强值") | [Go](problems/the-k-strongest-values-in-an-array) | Medium |
8490
| <span id="1470">1470</span> | [Shuffle the Array](https://leetcode.com/problems/shuffle-the-array "重新排列数组") | [Go](problems/shuffle-the-array) | Easy |
85-
| <span id="1469">1469</span> | [Find All The Lonely Nodes](https://leetcode.com/problems/find-all-the-lonely-nodes) 🔒 | [Go](problems/find-all-the-lonely-nodes) | Easy |
91+
| <span id="1469">1469</span> | [Find All The Lonely Nodes](https://leetcode.com/problems/find-all-the-lonely-nodes"寻找所有的独生节点") 🔒 | [Go](problems/find-all-the-lonely-nodes) | Easy |
8692
| <span id="1468">1468</span> | [Calculate Salaries](https://leetcode.com/problems/calculate-salaries "计算税后工资") 🔒 | [MySQL](problems/calculate-salaries) | Medium |
8793
| <span id="1467">1467</span> | [Probability of a Two Boxes Having The Same Number of Distinct Balls](https://leetcode.com/problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls "两个盒子中球的颜色数相同的概率") | [Go](problems/probability-of-a-two-boxes-having-the-same-number-of-distinct-balls) | Hard |
8894
| <span id="1466">1466</span> | [Reorder Routes to Make All Paths Lead to the City Zero](https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero "重新规划路线") | [Go](problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero) | Medium |
@@ -116,13 +122,13 @@ LeetCode Problems' Solutions
116122
| <span id="1438">1438</span> | [Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit](https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit "绝对差不超过限制的最长连续子数组") | [Go](problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit) | Medium |
117123
| <span id="1437">1437</span> | [Check If All 1's Are at Least Length K Places Away](https://leetcode.com/problems/check-if-all-1s-are-at-least-length-k-places-away "是否所有 1 都至少相隔 k 个元素") | [Go](problems/check-if-all-1s-are-at-least-length-k-places-away) | Medium |
118124
| <span id="1436">1436</span> | [Destination City](https://leetcode.com/problems/destination-city "旅行终点站") | [Go](problems/destination-city) | Easy |
119-
| <span id="1435">1435</span> | [Create a Session Bar Chart](https://leetcode.com/problems/create-a-session-bar-chart) 🔒 | [MySQL](problems/create-a-session-bar-chart) | Easy |
125+
| <span id="1435">1435</span> | [Create a Session Bar Chart](https://leetcode.com/problems/create-a-session-bar-chart"制作会话柱状图") 🔒 | [MySQL](problems/create-a-session-bar-chart) | Easy |
120126
| <span id="1434">1434</span> | [Number of Ways to Wear Different Hats to Each Other](https://leetcode.com/problems/number-of-ways-to-wear-different-hats-to-each-other "每个人戴不同帽子的方案数") | [Go](problems/number-of-ways-to-wear-different-hats-to-each-other) | Hard |
121127
| <span id="1433">1433</span> | [Check If a String Can Break Another String](https://leetcode.com/problems/check-if-a-string-can-break-another-string "检查一个字符串是否可以打破另一个字符串") | [Go](problems/check-if-a-string-can-break-another-string) | Medium |
122128
| <span id="1432">1432</span> | [Max Difference You Can Get From Changing an Integer](https://leetcode.com/problems/max-difference-you-can-get-from-changing-an-integer "改变一个整数能得到的最大差值") | [Go](problems/max-difference-you-can-get-from-changing-an-integer) | Medium |
123129
| <span id="1431">1431</span> | [Kids With the Greatest Number of Candies](https://leetcode.com/problems/kids-with-the-greatest-number-of-candies "拥有最多糖果的孩子") | [Go](problems/kids-with-the-greatest-number-of-candies) | Easy |
124-
| <span id="1430">1430</span> | [Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree) 🔒 | [Go](problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree) | Medium |
125-
| <span id="1429">1429</span> | [First Unique Number](https://leetcode.com/problems/first-unique-number) 🔒 | [Go](problems/first-unique-number) | Medium |
130+
| <span id="1430">1430</span> | [Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree"判断给定的序列是否是二叉树从根到叶的路径") 🔒 | [Go](problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree) | Medium |
131+
| <span id="1429">1429</span> | [First Unique Number](https://leetcode.com/problems/first-unique-number"第一个唯一数字") 🔒 | [Go](problems/first-unique-number) | Medium |
126132
| <span id="1428">1428</span> | [Leftmost Column with at Least a One](https://leetcode.com/problems/leftmost-column-with-at-least-a-one "至少有一个 1 的最左端列") 🔒 | [Go](problems/leftmost-column-with-at-least-a-one) | Medium |
127133
| <span id="1427">1427</span> | [Perform String Shifts](https://leetcode.com/problems/perform-string-shifts "字符串的左右移") 🔒 | [Go](problems/perform-string-shifts) | Easy |
128134
| <span id="1426">1426</span> | [Counting Elements](https://leetcode.com/problems/counting-elements "数元素") 🔒 | [Go](problems/counting-elements) | Easy |
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author openset <openset.wang@gmail.com> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
7+
8+
[< Previous](../clone-n-ary-tree "Clone N-ary Tree")
9+
10+
[Next >](../the-kth-factor-of-n "The kth Factor of n")
11+
12+
## [1491. Average Salary Excluding the Minimum and Maximum Salary (Easy)](https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary "去掉最低工资和最高工资后的工资平均值")
13+
14+
<p>Given an array of <strong>unique</strong> integers <code>salary</code>&nbsp;where <code>salary[i]</code> is the salary of the employee <code>i</code>.</p>
15+
16+
<p>Return the average salary of employees excluding the minimum and maximum salary.</p>
17+
18+
<p>&nbsp;</p>
19+
<p><strong>Example 1:</strong></p>
20+
21+
<pre>
22+
<strong>Input:</strong> salary = [4000,3000,1000,2000]
23+
<strong>Output:</strong> 2500.00000
24+
<strong>Explanation: </strong>Minimum salary and maximum salary are 1000 and 4000 respectively.
25+
Average salary excluding minimum and maximum salary is (2000+3000)/2= 2500
26+
</pre>
27+
28+
<p><strong>Example 2:</strong></p>
29+
30+
<pre>
31+
<strong>Input:</strong> salary = [1000,2000,3000]
32+
<strong>Output:</strong> 2000.00000
33+
<strong>Explanation: </strong>Minimum salary and maximum salary are 1000 and 3000 respectively.
34+
Average salary excluding minimum and maximum salary is (2000)/1= 2000
35+
</pre>
36+
37+
<p><strong>Example 3:</strong></p>
38+
39+
<pre>
40+
<strong>Input:</strong> salary = [6000,5000,4000,3000,2000,1000]
41+
<strong>Output:</strong> 3500.00000
42+
</pre>
43+
44+
<p><strong>Example 4:</strong></p>
45+
46+
<pre>
47+
<strong>Input:</strong> salary = [8000,9000,2000,3000,6000,1000]
48+
<strong>Output:</strong> 4750.00000
49+
</pre>
50+
51+
<p>&nbsp;</p>
52+
<p><strong>Constraints:</strong></p>
53+
54+
<ul>
55+
<li><code>3 &lt;= salary.length &lt;= 100</code></li>
56+
<li><code>10^3&nbsp;&lt;= salary[i] &lt;= 10^6</code></li>
57+
<li><code>salary[i]</code> is unique.</li>
58+
<li>Answers within <code>10^-5</code> of the actual value will be accepted as correct.</li>
59+
</ul>
60+
61+
### Related Topics
62+
[[Sort](../../tag/sort/README.md)]
63+
[[Array](../../tag/array/README.md)]
64+
65+
### Hints
66+
<details>
67+
<summary>Hint 1</summary>
68+
Get the total sum and subtract the minimum and maximum value in the array. Finally divide the result by n - 2.
69+
</details>

‎problems/buddy-strings/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,20 @@
5454
<strong>Input: </strong>A = <span id="example-input-5-1">&quot;&quot;</span>, B = <span id="example-input-5-2">&quot;aa&quot;</span>
5555
<strong>Output: </strong><span id="example-output-5">false</span>
5656
</pre>
57+
</div>
58+
</div>
59+
</div>
60+
</div>
61+
</div>
5762

5863
<p>&nbsp;</p>
64+
<p><strong>Constraints:</strong></p>
5965

60-
<p><strong><span>Note:</span></strong></p>
61-
62-
<ol>
66+
<ul>
6367
<li><code>0 &lt;= A.length &lt;= 20000</code></li>
6468
<li><code>0 &lt;= B.length &lt;= 20000</code></li>
6569
<li><code>A</code> and&nbsp;<code>B</code> consist only of lowercase letters.</li>
66-
</ol>
67-
</div>
68-
</div>
69-
</div>
70-
</div>
71-
</div>
70+
</ul>
7271

7372
### Related Topics
7473
[[String](../../tag/string/README.md)]

‎problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/README.md

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

1010
[Next >](../kids-with-the-greatest-number-of-candies "Kids With the Greatest Number of Candies")
1111

12-
## [1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree (Medium)](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree "")
12+
## [1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree (Medium)](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree "判断给定的序列是否是二叉树从根到叶的路径")
1313

1414

1515

‎problems/climbing-stairs/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
<p>Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?</p>
1717

18-
<p><strong>Note:</strong> Given <em>n</em> will be a positive integer.</p>
19-
2018
<p><strong>Example 1:</strong></p>
2119

2220
<pre>
@@ -38,6 +36,13 @@
3836
3. 2 steps + 1 step
3937
</pre>
4038

39+
<p>&nbsp;</p>
40+
<p><strong>Constraints:</strong></p>
41+
42+
<ul>
43+
<li><code>1 &lt;= n &lt;= 45</code></li>
44+
</ul>
45+
4146
### Related Topics
4247
[[Dynamic Programming](../../tag/dynamic-programming/README.md)]
4348

‎problems/clone-n-ary-tree/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author openset <openset.wang@gmail.com> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
7+
8+
[< Previous](../find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree")
9+
10+
[Next >](../average-salary-excluding-the-minimum-and-maximum-salary "Average Salary Excluding the Minimum and Maximum Salary")
11+
12+
## [1490. Clone N-ary Tree (Medium)](https://leetcode.com/problems/clone-n-ary-tree "克隆 N 叉树")
13+
14+
15+
16+
### Related Topics
17+
[[Tree](../../tag/tree/README.md)]
18+
[[Depth-first Search](../../tag/depth-first-search/README.md)]
19+
[[Breadth-first Search](../../tag/breadth-first-search/README.md)]
20+
[[Hash Table](../../tag/hash-table/README.md)]
21+
22+
### Hints
23+
<details>
24+
<summary>Hint 1</summary>
25+
Traverse the tree, keep a hashtable with you and create a clone node for each node in the tree.
26+
</details>
27+
28+
<details>
29+
<summary>Hint 2</summary>
30+
Start traversing the original tree again and connect each child pointer in the cloned tree the same way as the original tree with the help of the hashtable.
31+
</details>

‎problems/create-a-session-bar-chart/README.md

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

1010
[Next >](../destination-city "Destination City")
1111

12-
## [1435. Create a Session Bar Chart (Easy)](https://leetcode.com/problems/create-a-session-bar-chart "")
12+
## [1435. Create a Session Bar Chart (Easy)](https://leetcode.com/problems/create-a-session-bar-chart "制作会话柱状图")
1313

1414

‎problems/excel-sheet-column-number/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
<strong>Input: </strong>&quot;ZY&quot;
4747
<strong>Output:</strong> 701
4848
</pre>
49+
<p>&nbsp;</p>
50+
<p><strong>Constraints:</strong></p>
51+
52+
<ul>
53+
<li><code>1 &lt;= s.length &lt;= 7</code></li>
54+
<li><code>s</code> consists only of uppercase English letters.</li>
55+
<li><code>s</code> is between &quot;A&quot; and &quot;FXSHRXW&quot;.</li>
56+
</ul>
4957

5058
### Related Topics
5159
[[Math](../../tag/math/README.md)]

‎problems/find-all-the-lonely-nodes/README.md

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

1010
[Next >](../shuffle-the-array "Shuffle the Array")
1111

12-
## [1469. Find All The Lonely Nodes (Easy)](https://leetcode.com/problems/find-all-the-lonely-nodes "")
12+
## [1469. Find All The Lonely Nodes (Easy)](https://leetcode.com/problems/find-all-the-lonely-nodes "寻找所有的独生节点")
1313

1414

1515

‎problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/README.md

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

88
[< Previous](../avoid-flood-in-the-city "Avoid Flood in The City")
99

10-
Next >
10+
[Next >](../clone-n-ary-tree"Clone N-ary Tree")
1111

1212
## [1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree (Hard)](https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree "找到最小生成树里的关键边和伪关键边")
1313

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /