Skip to content

Commit 5cb5efd

Browse files
author
Shuo
authored
Merge pull request #591 from openset/develop
Add: v1.3.2
2 parents 0a59f0b + 73f7be3 commit 5cb5efd

File tree

11 files changed

+131
-2
lines changed

11 files changed

+131
-2
lines changed

internal/version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/openset/leetcode/internal/base"
88
)
99

10-
const version = "1.3.1"
10+
const version = "1.3.2"
1111

1212
var CmdVersion = &base.Command{
1313
Run: runVersion,
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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](https://github.com/openset/leetcode/tree/master/problems/inorder-successor-in-bst-ii "Inorder Successor in BST II")
9+
                
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-ii "Game Play Analysis II")
11+
12+
## 511. Game Play Analysis I (Easy)
13+
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
2+
Truncate table Activity;
3+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
4+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
5+
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
6+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
7+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-i "Game Play Analysis I")
9+
                
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/find-bottom-left-tree-value "Find Bottom Left Tree Value")
11+
12+
## 512. Game Play Analysis II (Easy)
13+
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
2+
Truncate table Activity;
3+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
4+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
5+
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
6+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
7+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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](https://github.com/openset/leetcode/tree/master/problems/lonely-pixel-ii "Lonely Pixel II")
9+
                
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/encode-and-decode-tinyurl "Encode and Decode TinyURL")
11+
12+
## 534. Game Play Analysis III (Medium)
13+
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
2+
Truncate table Activity;
3+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
4+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
5+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '3', '2017-06-25', '1');
6+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
7+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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](https://github.com/openset/leetcode/tree/master/problems/binary-tree-longest-consecutive-sequence-ii "Binary Tree Longest Consecutive Sequence II")
9+
                
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/student-attendance-record-i "Student Attendance Record I")
11+
12+
## 550. Game Play Analysis IV (Medium)
13+
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
2+
Truncate table Activity;
3+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
4+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-02', '6');
5+
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
6+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
7+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');

problems/high-five/README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,38 @@
1111

1212
## 1086. High Five (Easy)
1313

14+
<p>Given a list of scores of different students, return the average score of each student&#39;s <strong>top five scores</strong> in<strong> the order of each student&#39;s id</strong>.</p>
1415

16+
<p>Each entry <code>items[i]</code>&nbsp;has <code>items[i][0]</code> the student&#39;s id, and <code>items[i][1]</code> the student&#39;s score.&nbsp; The average score is calculated using integer division.</p>
17+
18+
<p>&nbsp;</p>
19+
20+
<p><strong>Example 1:</strong></p>
21+
22+
<pre>
23+
<strong>Input: </strong><span id="example-input-1-1">[[1,91],[1,92],[2,93],[2,97],[1,60],[2,77],[1,65],[1,87],[1,100],[2,100],[2,76]]</span>
24+
<strong>Output: </strong><span id="example-output-1">[[1,87],[2,88]]</span>
25+
<strong>Explanation: </strong>
26+
The average of the student with id = 1 is 87.
27+
The average of the student with id = 2 is 88.6. But with integer division their average converts to 88.
28+
</pre>
29+
30+
<p>&nbsp;</p>
31+
32+
<p><strong>Note:</strong></p>
33+
34+
<ol>
35+
<li><code>1 &lt;= items.length &lt;= 1000</code></li>
36+
<li><code>items[i].length == 2</code></li>
37+
<li>The IDs of the students is between <code>1</code> to <code>1000</code></li>
38+
<li>The score of the students is between <code>1</code> to <code>100</code></li>
39+
<li>For each student,&nbsp;there are at least 5 scores</li>
40+
</ol>
1541

1642
### Related Topics
43+
[[Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)]
1744
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
1845
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]
19-
[[Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)]
2046

2147
### Hints
2248
<details>

problems/insufficient-nodes-in-root-to-leaf-paths/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ Output: </strong><span id="example-output-1">[1,2,3,4,null,null,7,8,9,null,14]</
3636
Input: </strong>root = <span id="example-input-2-1">[5,4,8,11,null,17,4,7,1,null,null,5,3]</span>, limit = <span id="example-input-2-2">22</span>
3737
<strong><img alt="" src="https://assets.leetcode.com/uploads/2019/06/05/insufficient-4.png" style="width: 264px; height: 200px;" />
3838
Output: </strong><span id="example-output-2">[5,4,8,11,null,17,4,7,null,null,null,5]</span></pre>
39+
40+
<p>&nbsp;</p>
41+
42+
<p><strong>Example 3:</strong></p>
43+
44+
<pre>
45+
<strong><img alt="" src="https://assets.leetcode.com/uploads/2019/06/11/screen-shot-2019-06-11-at-83301-pm.png" style="width: 188px; height: 150px;" />
46+
Input: </strong>root = <span>[1,2,-3,-5,null,4,null]</span>, limit = -1
47+
<img alt="" src="https://assets.leetcode.com/uploads/2019/06/11/screen-shot-2019-06-11-at-83517-pm.png" style="width: 122px; height: 150px;" /><strong>
48+
Output: </strong><span>[1,null,-3,4]</span></pre>
3949
</div>
4050

4151
<p>&nbsp;</p>
@@ -51,3 +61,12 @@ Output: </strong><span id="example-output-2">[5,4,8,11,null,17,4,7,null,null,nul
5161
<div>
5262
<div>&nbsp;</div>
5363
</div>
64+
65+
### Related Topics
66+
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]
67+
68+
### Hints
69+
<details>
70+
<summary>Hint 1</summary>
71+
Consider a DFS traversal of the tree. You can keep track of the current path sum from root to this node, and you can also use DFS to return the minimum value of any path from this node to the leaf. This will tell you if this node is insufficient.
72+
</details>

0 commit comments

Comments
 (0)