Skip to content

Add: v1.3.2 #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/openset/leetcode/internal/base"
)

const version = "1.3.1"
const version = "1.3.2"

var CmdVersion = &base.Command{
Run: runVersion,
Expand Down
14 changes: 14 additions & 0 deletions problems/game-play-analysis-i/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->

[< Previous](https://github.com/openset/leetcode/tree/master/problems/inorder-successor-in-bst-ii "Inorder Successor in BST II")

[Next >](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-ii "Game Play Analysis II")

## 511. Game Play Analysis I (Easy)


7 changes: 7 additions & 0 deletions problems/game-play-analysis-i/mysql_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
Truncate table Activity;
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
14 changes: 14 additions & 0 deletions problems/game-play-analysis-ii/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->

[< Previous](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-i "Game Play Analysis I")

[Next >](https://github.com/openset/leetcode/tree/master/problems/find-bottom-left-tree-value "Find Bottom Left Tree Value")

## 512. Game Play Analysis II (Easy)


7 changes: 7 additions & 0 deletions problems/game-play-analysis-ii/mysql_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
Truncate table Activity;
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
14 changes: 14 additions & 0 deletions problems/game-play-analysis-iii/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->

[< Previous](https://github.com/openset/leetcode/tree/master/problems/lonely-pixel-ii "Lonely Pixel II")

[Next >](https://github.com/openset/leetcode/tree/master/problems/encode-and-decode-tinyurl "Encode and Decode TinyURL")

## 534. Game Play Analysis III (Medium)


7 changes: 7 additions & 0 deletions problems/game-play-analysis-iii/mysql_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
Truncate table Activity;
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-05-02', '6');
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '3', '2017-06-25', '1');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
14 changes: 14 additions & 0 deletions problems/game-play-analysis-iv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->

[< Previous](https://github.com/openset/leetcode/tree/master/problems/binary-tree-longest-consecutive-sequence-ii "Binary Tree Longest Consecutive Sequence II")

[Next >](https://github.com/openset/leetcode/tree/master/problems/student-attendance-record-i "Student Attendance Record I")

## 550. Game Play Analysis IV (Medium)


7 changes: 7 additions & 0 deletions problems/game-play-analysis-iv/mysql_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
Truncate table Activity;
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-02', '6');
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-02', '0');
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');
28 changes: 27 additions & 1 deletion problems/high-five/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,38 @@

## 1086. High Five (Easy)

<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>

<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>

<p>&nbsp;</p>

<p><strong>Example 1:</strong></p>

<pre>
<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>
<strong>Output: </strong><span id="example-output-1">[[1,87],[2,88]]</span>
<strong>Explanation: </strong>
The average of the student with id = 1 is 87.
The average of the student with id = 2 is 88.6. But with integer division their average converts to 88.
</pre>

<p>&nbsp;</p>

<p><strong>Note:</strong></p>

<ol>
<li><code>1 &lt;= items.length &lt;= 1000</code></li>
<li><code>items[i].length == 2</code></li>
<li>The IDs of the students is between <code>1</code> to <code>1000</code></li>
<li>The score of the students is between <code>1</code> to <code>100</code></li>
<li>For each student,&nbsp;there are at least 5 scores</li>
</ol>

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

### Hints
<details>
Expand Down
19 changes: 19 additions & 0 deletions problems/insufficient-nodes-in-root-to-leaf-paths/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ Output: </strong><span id="example-output-1">[1,2,3,4,null,null,7,8,9,null,14]</
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>
<strong><img alt="" src="https://assets.leetcode.com/uploads/2019/06/05/insufficient-4.png" style="width: 264px; height: 200px;" />
Output: </strong><span id="example-output-2">[5,4,8,11,null,17,4,7,null,null,null,5]</span></pre>

<p>&nbsp;</p>

<p><strong>Example 3:</strong></p>

<pre>
<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;" />
Input: </strong>root = <span>[1,2,-3,-5,null,4,null]</span>, limit = -1
<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>
Output: </strong><span>[1,null,-3,4]</span></pre>
</div>

<p>&nbsp;</p>
Expand All @@ -51,3 +61,12 @@ Output: </strong><span id="example-output-2">[5,4,8,11,null,17,4,7,null,null,nul
<div>
<div>&nbsp;</div>
</div>

### Related Topics
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]

### Hints
<details>
<summary>Hint 1</summary>
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.
</details>