diff --git a/internal/version/version.go b/internal/version/version.go index 81a77db46..ddba303bf 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -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, diff --git a/problems/game-play-analysis-i/README.md b/problems/game-play-analysis-i/README.md new file mode 100644 index 000000000..fdf78733e --- /dev/null +++ b/problems/game-play-analysis-i/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< 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) + + diff --git a/problems/game-play-analysis-i/mysql_schemas.sql b/problems/game-play-analysis-i/mysql_schemas.sql new file mode 100644 index 000000000..519a7e42c --- /dev/null +++ b/problems/game-play-analysis-i/mysql_schemas.sql @@ -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'); diff --git a/problems/game-play-analysis-ii/README.md b/problems/game-play-analysis-ii/README.md new file mode 100644 index 000000000..fb0791978 --- /dev/null +++ b/problems/game-play-analysis-ii/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< 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) + + diff --git a/problems/game-play-analysis-ii/mysql_schemas.sql b/problems/game-play-analysis-ii/mysql_schemas.sql new file mode 100644 index 000000000..519a7e42c --- /dev/null +++ b/problems/game-play-analysis-ii/mysql_schemas.sql @@ -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'); diff --git a/problems/game-play-analysis-iii/README.md b/problems/game-play-analysis-iii/README.md new file mode 100644 index 000000000..dc8bb17e1 --- /dev/null +++ b/problems/game-play-analysis-iii/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< 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) + + diff --git a/problems/game-play-analysis-iii/mysql_schemas.sql b/problems/game-play-analysis-iii/mysql_schemas.sql new file mode 100644 index 000000000..cb1a27f6d --- /dev/null +++ b/problems/game-play-analysis-iii/mysql_schemas.sql @@ -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'); diff --git a/problems/game-play-analysis-iv/README.md b/problems/game-play-analysis-iv/README.md new file mode 100644 index 000000000..0f93f406b --- /dev/null +++ b/problems/game-play-analysis-iv/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< 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) + + diff --git a/problems/game-play-analysis-iv/mysql_schemas.sql b/problems/game-play-analysis-iv/mysql_schemas.sql new file mode 100644 index 000000000..19191e384 --- /dev/null +++ b/problems/game-play-analysis-iv/mysql_schemas.sql @@ -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'); diff --git a/problems/high-five/README.md b/problems/high-five/README.md index b2beae86d..51acaa3f2 100644 --- a/problems/high-five/README.md +++ b/problems/high-five/README.md @@ -11,12 +11,38 @@ ## 1086. High Five (Easy) +
Given a list of scores of different students, return the average score of each student's top five scores in the order of each student's id.
+Each entry items[i]
has items[i][0]
the student's id, and items[i][1]
the student's score. The average score is calculated using integer division.
+ +
Example 1:
+ ++Input: [[1,91],[1,92],[2,93],[2,97],[1,60],[2,77],[1,65],[1,87],[1,100],[2,100],[2,76]] +Output: [[1,87],[2,88]] +Explanation: +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. ++ +
+ +
Note:
+ +1 <= items.length <= 1000
items[i].length == 2
1
to 1000
1
to 100
+ +
Example 3:
+ +++Input: root = [1,2,-3,-5,null,4,null], limit = -1 +
+Output: [1,null,-3,4]
@@ -51,3 +61,12 @@ Output: [5,4,8,11,null,17,4,7,null,null,nul