Skip to content

Add: problem 1194 #653

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
Sep 18, 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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ LeetCode Problems' Solutions

| # | Title | Solution | Difficulty |
| :-: | - | - | :-: |
| <span id="1194">1194</span> | [Tournament Winners](https://leetcode.com/problems/tournament-winners) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/tournament-winners) | Hard |
| <span id="1193">1193</span> | [Monthly Transactions I](https://leetcode.com/problems/monthly-transactions-i) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/monthly-transactions-i) | Medium |
| <span id="1192">1192</span> | [Critical Connections in a Network](https://leetcode.com/problems/critical-connections-in-a-network "查找集群内的「关键连接」") | [Go](https://github.com/openset/leetcode/tree/master/problems/critical-connections-in-a-network) | Hard |
| <span id="1191">1191</span> | [K-Concatenation Maximum Sum](https://leetcode.com/problems/k-concatenation-maximum-sum "K 次串联后最大子数组之和") | [Go](https://github.com/openset/leetcode/tree/master/problems/k-concatenation-maximum-sum) | Medium |
| <span id="1190">1190</span> | [Reverse Substrings Between Each Pair of Parentheses](https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses "反转每对括号间的子串") | [Go](https://github.com/openset/leetcode/tree/master/problems/reverse-substrings-between-each-pair-of-parentheses) | Medium |
Expand Down
2 changes: 1 addition & 1 deletion problems/critical-connections-in-a-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[< Previous](https://github.com/openset/leetcode/tree/master/problems/k-concatenation-maximum-sum "K-Concatenation Maximum Sum")

Next >
[Next >](https://github.com/openset/leetcode/tree/master/problems/monthly-transactions-i "Monthly Transactions I")

## 1192. Critical Connections in a Network (Hard)

Expand Down
5 changes: 1 addition & 4 deletions problems/day-of-the-week/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@author openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->
Expand Down Expand Up @@ -46,9 +46,6 @@
<li>The given dates are valid&nbsp;dates between the years <code>1971</code> and <code>2100</code>.</li>
</ul>

### Related Topics
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]

### Hints
<details>
<summary>Hint 1</summary>
Expand Down
5 changes: 1 addition & 4 deletions problems/distance-between-bus-stops/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@author openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->
Expand Down Expand Up @@ -61,9 +61,6 @@
<li><code>0 &lt;= distance[i] &lt;= 10^4</code></li>
</ul>

### Related Topics
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]

### Hints
<details>
<summary>Hint 1</summary>
Expand Down
4 changes: 2 additions & 2 deletions problems/maximum-number-of-ones/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@author openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->
Expand All @@ -14,8 +14,8 @@


### Related Topics
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]
[[Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)]
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]

### Hints
<details>
Expand Down
5 changes: 1 addition & 4 deletions problems/maximum-subarray-sum-with-one-deletion/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@author openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->
Expand Down Expand Up @@ -47,9 +47,6 @@
<li><code>-10^4 &lt;= arr[i] &lt;= 10^4</code></li>
</ul>

### Related Topics
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]

### Hints
<details>
<summary>Hint 1</summary>
Expand Down
14 changes: 14 additions & 0 deletions problems/monthly-transactions-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/critical-connections-in-a-network "Critical Connections in a Network")

[Next >](https://github.com/openset/leetcode/tree/master/problems/tournament-winners "Tournament Winners")

## 1193. Monthly Transactions I (Medium)


6 changes: 6 additions & 0 deletions problems/monthly-transactions-i/mysql_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
create table if not exists Transactions (id int, country varchar(4), state enum('approved', 'declined'), amount int, trans_date date);
Truncate table Transactions;
insert into Transactions (id, country, state, amount, trans_date) values ('121', 'US', 'approved', '1000', '2018-12-18');
insert into Transactions (id, country, state, amount, trans_date) values ('122', 'US', 'declined', '2000', '2018-12-19');
insert into Transactions (id, country, state, amount, trans_date) values ('123', 'US', 'approved', '2000', '2019-01-01');
insert into Transactions (id, country, state, amount, trans_date) values ('124', 'DE', 'approved', '2000', '2019-01-07');
14 changes: 14 additions & 0 deletions problems/tournament-winners/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/monthly-transactions-i "Monthly Transactions I")

Next >

## 1194. Tournament Winners (Hard)


19 changes: 19 additions & 0 deletions problems/tournament-winners/mysql_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Create table If Not Exists Players (player_id int, group_id int);
Create table If Not Exists Matches (match_id int, first_player int, second_player int, first_score int, second_score int)
;
Truncate table Players;
insert into Players (player_id, group_id) values ('10', '2');
insert into Players (player_id, group_id) values ('15', '1');
insert into Players (player_id, group_id) values ('20', '3');
insert into Players (player_id, group_id) values ('25', '1');
insert into Players (player_id, group_id) values ('30', '1');
insert into Players (player_id, group_id) values ('35', '2');
insert into Players (player_id, group_id) values ('40', '3');
insert into Players (player_id, group_id) values ('45', '1');
insert into Players (player_id, group_id) values ('50', '2');
Truncate table Matches;
insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('1', '15', '45', '3', '0');
insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('2', '30', '25', '1', '2');
insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('3', '30', '15', '2', '0');
insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('4', '40', '20', '5', '2');
insert into Matches (match_id, first_player, second_player, first_score, second_score) values ('5', '35', '50', '1', '1');