From 5e05a2299f70fec2062069fb67787c97170f4ea5 Mon Sep 17 00:00:00 2001 From: openset Date: Sun, 29 Sep 2019 09:40:45 +0800 Subject: [PATCH] Add: new --- README.md | 7 ++++--- problems/fizz-buzz-multithreaded/README.md | 6 +----- problems/game-play-analysis-iv/README.md | 2 +- .../last-person-to-fit-in-the-elevator/README.md | 2 +- problems/longest-common-subsequence/README.md | 10 +--------- problems/monthly-transactions-ii/README.md | 14 ++++++++++++++ problems/monthly-transactions-ii/mysql_schemas.sql | 14 ++++++++++++++ problems/product-sales-analysis-iii/README.md | 2 +- .../README.md | 1 + readme/301-600.md | 2 +- 10 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 problems/monthly-transactions-ii/README.md create mode 100644 problems/monthly-transactions-ii/mysql_schemas.sql diff --git a/README.md b/README.md index 4423a5d6d..5b75abbe4 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ LeetCode Problems' Solutions | # | Title | Solution | Difficulty | | :-: | - | - | :-: | +| 1205 | [Monthly Transactions II](https://leetcode.com/problems/monthly-transactions-ii) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/monthly-transactions-ii) | Medium | | 1204 | [Last Person to Fit in the Elevator](https://leetcode.com/problems/last-person-to-fit-in-the-elevator) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/last-person-to-fit-in-the-elevator) | Medium | | 1203 | [Sort Items by Groups Respecting Dependencies](https://leetcode.com/problems/sort-items-by-groups-respecting-dependencies "้กน็›ฎ็ฎก็†") | [Go](https://github.com/openset/leetcode/tree/master/problems/sort-items-by-groups-respecting-dependencies) | Hard | | 1202 | [Smallest String With Swaps](https://leetcode.com/problems/smallest-string-with-swaps "ไบคๆขๅญ—็ฌฆไธฒไธญ็š„ๅ…ƒ็ด ") | [Go](https://github.com/openset/leetcode/tree/master/problems/smallest-string-with-swaps) | Medium | @@ -71,7 +72,7 @@ LeetCode Problems' Solutions | 1198 | [Find Smallest Common Element in All Rows](https://leetcode.com/problems/find-smallest-common-element-in-all-rows "ๆ‰พๅ‡บๆ‰€ๆœ‰่กŒไธญๆœ€ๅฐๅ…ฌๅ…ฑๅ…ƒ็ด ") ๐Ÿ”’ | [Go](https://github.com/openset/leetcode/tree/master/problems/find-smallest-common-element-in-all-rows) | Medium | | 1197 | [Minimum Knight Moves](https://leetcode.com/problems/minimum-knight-moves "่ฟ›ๅ‡ป็š„้ช‘ๅฃซ") ๐Ÿ”’ | [Go](https://github.com/openset/leetcode/tree/master/problems/minimum-knight-moves) | Medium | | 1196 | [How Many Apples Can You Put into the Basket](https://leetcode.com/problems/how-many-apples-can-you-put-into-the-basket "ๆœ€ๅคšๅฏไปฅไนฐๅˆฐ็š„่‹นๆžœๆ•ฐ้‡") ๐Ÿ”’ | [Go](https://github.com/openset/leetcode/tree/master/problems/how-many-apples-can-you-put-into-the-basket) | Easy | -| 1195 | [Fizz Buzz Multithreaded](https://leetcode.com/problems/fizz-buzz-multithreaded) | [Go](https://github.com/openset/leetcode/tree/master/problems/fizz-buzz-multithreaded) | Medium | +| 1195 | [Fizz Buzz Multithreaded](https://leetcode.com/problems/fizz-buzz-multithreaded "ไบคๆ›ฟๆ‰“ๅฐๅญ—็ฌฆไธฒ") | [Go](https://github.com/openset/leetcode/tree/master/problems/fizz-buzz-multithreaded) | Medium | | 1194 | [Tournament Winners](https://leetcode.com/problems/tournament-winners) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/tournament-winners) | Hard | | 1193 | [Monthly Transactions I](https://leetcode.com/problems/monthly-transactions-i "ๆฏๆœˆไบคๆ˜“ I") ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/monthly-transactions-i) | Medium | | 1192 | [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 | @@ -123,7 +124,7 @@ LeetCode Problems' Solutions | 1146 | [Snapshot Array](https://leetcode.com/problems/snapshot-array "ๅฟซ็…งๆ•ฐ็ป„") | [Go](https://github.com/openset/leetcode/tree/master/problems/snapshot-array) | Medium | | 1145 | [Binary Tree Coloring Game](https://leetcode.com/problems/binary-tree-coloring-game "ไบŒๅ‰ๆ ‘็€่‰ฒๆธธๆˆ") | [Go](https://github.com/openset/leetcode/tree/master/problems/binary-tree-coloring-game) | Medium | | 1144 | [Decrease Elements To Make Array Zigzag](https://leetcode.com/problems/decrease-elements-to-make-array-zigzag "้€’ๅ‡ๅ…ƒ็ด ไฝฟๆ•ฐ็ป„ๅ‘ˆ้”ฏ้ฝฟ็Šถ") | [Go](https://github.com/openset/leetcode/tree/master/problems/decrease-elements-to-make-array-zigzag) | Medium | -| 1143 | [Longest Common Subsequence](https://leetcode.com/problems/longest-common-subsequence) | [Go](https://github.com/openset/leetcode/tree/master/problems/longest-common-subsequence) | Medium | +| 1143 | [Longest Common Subsequence](https://leetcode.com/problems/longest-common-subsequence "ๆœ€้•ฟๅ…ฌๅ…ฑๅญๅบๅˆ—") | [Go](https://github.com/openset/leetcode/tree/master/problems/longest-common-subsequence) | Medium | | 1142 | [User Activity for the Past 30 Days II](https://leetcode.com/problems/user-activity-for-the-past-30-days-ii) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/user-activity-for-the-past-30-days-ii) | Easy | | 1141 | [User Activity for the Past 30 Days I](https://leetcode.com/problems/user-activity-for-the-past-30-days-i) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/user-activity-for-the-past-30-days-i) | Easy | | 1140 | [Stone Game II](https://leetcode.com/problems/stone-game-ii "็Ÿณๅญๆธธๆˆ II") | [Go](https://github.com/openset/leetcode/tree/master/problems/stone-game-ii) | Medium | @@ -196,7 +197,7 @@ LeetCode Problems' Solutions | 1073 | [Adding Two Negabinary Numbers](https://leetcode.com/problems/adding-two-negabinary-numbers "่ดŸไบŒ่ฟ›ๅˆถๆ•ฐ็›ธๅŠ ") | [Go](https://github.com/openset/leetcode/tree/master/problems/adding-two-negabinary-numbers) | Medium | | 1072 | [Flip Columns For Maximum Number of Equal Rows](https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows "ๆŒ‰ๅˆ—็ฟป่ฝฌๅพ—ๅˆฐๆœ€ๅคงๅ€ผ็ญ‰่กŒๆ•ฐ") | [Go](https://github.com/openset/leetcode/tree/master/problems/flip-columns-for-maximum-number-of-equal-rows) | Medium | | 1071 | [Greatest Common Divisor of Strings](https://leetcode.com/problems/greatest-common-divisor-of-strings "ๅญ—็ฌฆไธฒ็š„ๆœ€ๅคงๅ…ฌๅ› ๅญ") | [Go](https://github.com/openset/leetcode/tree/master/problems/greatest-common-divisor-of-strings) | Easy | -| 1070 | [Product Sales Analysis III](https://leetcode.com/problems/product-sales-analysis-iii) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/product-sales-analysis-iii) | Medium | +| 1070 | [Product Sales Analysis III](https://leetcode.com/problems/product-sales-analysis-iii "ไบงๅ“้”€ๅ”ฎๅˆ†ๆž III") ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/product-sales-analysis-iii) | Medium | | 1069 | [Product Sales Analysis II](https://leetcode.com/problems/product-sales-analysis-ii "ไบงๅ“้”€ๅ”ฎๅˆ†ๆž II") ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/product-sales-analysis-ii) | Easy | | 1068 | [Product Sales Analysis I](https://leetcode.com/problems/product-sales-analysis-i "ไบงๅ“้”€ๅ”ฎๅˆ†ๆž I") ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/product-sales-analysis-i) | Easy | | 1067 | [Digit Count in Range](https://leetcode.com/problems/digit-count-in-range "่Œƒๅ›ดๅ†…็š„ๆ•ฐๅญ—่ฎกๆ•ฐ") ๐Ÿ”’ | [Go](https://github.com/openset/leetcode/tree/master/problems/digit-count-in-range) | Hard | diff --git a/problems/fizz-buzz-multithreaded/README.md b/problems/fizz-buzz-multithreaded/README.md index f35fa1186..f5a3f3eb7 100644 --- a/problems/fizz-buzz-multithreaded/README.md +++ b/problems/fizz-buzz-multithreaded/README.md @@ -9,7 +9,7 @@ ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ [Next >](https://github.com/openset/leetcode/tree/master/problems/how-many-apples-can-you-put-into-the-basket "How Many Apples Can You Put into the Basket") -## [1195. Fizz Buzz Multithreaded (Medium)](https://leetcode.com/problems/fizz-buzz-multithreaded "") +## [1195. Fizz Buzz Multithreaded (Medium)](https://leetcode.com/problems/fizz-buzz-multithreaded "ไบคๆ›ฟๆ‰“ๅฐๅญ—็ฌฆไธฒ")

Write a program that outputs the string representation of numbers from 1 to n, however:

@@ -40,7 +40,3 @@ class FizzBuzz {
  • Thread C will call fizzbuzz() to check for divisibility of 3 and 5 and outputs fizzbuzz.
  • Thread D will call number() which should only output the numbers.
  • - -### Similar Questions - 1. [Fizz Buzz](https://github.com/openset/leetcode/tree/master/problems/fizz-buzz) (Easy) - 1. [Print Zero Even Odd](https://github.com/openset/leetcode/tree/master/problems/print-zero-even-odd) (Medium) diff --git a/problems/game-play-analysis-iv/README.md b/problems/game-play-analysis-iv/README.md index 76dea3e3e..a661503cf 100644 --- a/problems/game-play-analysis-iv/README.md +++ b/problems/game-play-analysis-iv/README.md @@ -9,7 +9,7 @@ ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ [Next >](https://github.com/openset/leetcode/tree/master/problems/student-attendance-record-i "Student Attendance Record I") -## [550. Game Play Analysis IV (Medium)](https://leetcode.com/problems/game-play-analysis-iv "") +## [550. Game Play Analysis IV (Medium)](https://leetcode.com/problems/game-play-analysis-iv "ๆธธๆˆ็Žฉๆณ•ๅˆ†ๆž IV") diff --git a/problems/last-person-to-fit-in-the-elevator/README.md b/problems/last-person-to-fit-in-the-elevator/README.md index 27699a406..fc3e3ee4c 100644 --- a/problems/last-person-to-fit-in-the-elevator/README.md +++ b/problems/last-person-to-fit-in-the-elevator/README.md @@ -7,7 +7,7 @@ [< Previous](https://github.com/openset/leetcode/tree/master/problems/sort-items-by-groups-respecting-dependencies "Sort Items by Groups Respecting Dependencies") ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ -Next > +[Next >](https://github.com/openset/leetcode/tree/master/problems/monthly-transactions-ii "Monthly Transactions II") ## [1204. Last Person to Fit in the Elevator (Medium)](https://leetcode.com/problems/last-person-to-fit-in-the-elevator "") diff --git a/problems/longest-common-subsequence/README.md b/problems/longest-common-subsequence/README.md index a3ae68e7d..4447b4774 100644 --- a/problems/longest-common-subsequence/README.md +++ b/problems/longest-common-subsequence/README.md @@ -9,7 +9,7 @@ ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ [Next >](https://github.com/openset/leetcode/tree/master/problems/decrease-elements-to-make-array-zigzag "Decrease Elements To Make Array Zigzag") -## [1143. Longest Common Subsequence (Medium)](https://leetcode.com/problems/longest-common-subsequence "") +## [1143. Longest Common Subsequence (Medium)](https://leetcode.com/problems/longest-common-subsequence "ๆœ€้•ฟๅ…ฌๅ…ฑๅญๅบๅˆ—")

    Given two strings text1 and text2, return the length of their longest common subsequence.

    @@ -53,14 +53,6 @@
  • The input strings consist of lowercase English characters only.
  • -### Related Topics - [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)] - -### Similar Questions - 1. [Longest Palindromic Subsequence](https://github.com/openset/leetcode/tree/master/problems/longest-palindromic-subsequence) (Medium) - 1. [Delete Operation for Two Strings](https://github.com/openset/leetcode/tree/master/problems/delete-operation-for-two-strings) (Medium) - 1. [Shortest Common Supersequence ](https://github.com/openset/leetcode/tree/master/problems/shortest-common-supersequence) (Hard) - ### Hints
    Hint 1 diff --git a/problems/monthly-transactions-ii/README.md b/problems/monthly-transactions-ii/README.md new file mode 100644 index 000000000..259697100 --- /dev/null +++ b/problems/monthly-transactions-ii/README.md @@ -0,0 +1,14 @@ + + + + + + + +[< Previous](https://github.com/openset/leetcode/tree/master/problems/last-person-to-fit-in-the-elevator "Last Person to Fit in the Elevator") +ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ +Next > + +## [1205. Monthly Transactions II (Medium)](https://leetcode.com/problems/monthly-transactions-ii "") + + diff --git a/problems/monthly-transactions-ii/mysql_schemas.sql b/problems/monthly-transactions-ii/mysql_schemas.sql new file mode 100644 index 000000000..7b54c5361 --- /dev/null +++ b/problems/monthly-transactions-ii/mysql_schemas.sql @@ -0,0 +1,14 @@ +create table if not exists Transactions (id int, country varchar(4), state enum('approved', 'declined'), amount int, trans_date date) +; +create table if not exists Chargebacks (trans_id int, trans_date date) +; +Truncate table Transactions; +insert into Transactions (id, country, state, amount, trans_date) values ('101', 'US', 'approved', '1000', '2019-05-18'); +insert into Transactions (id, country, state, amount, trans_date) values ('102', 'US', 'declined', '2000', '2019-05-19'); +insert into Transactions (id, country, state, amount, trans_date) values ('103', 'US', 'approved', '3000', '2019-06-10'); +insert into Transactions (id, country, state, amount, trans_date) values ('104', 'US', 'declined', '4000', '2019-06-13'); +insert into Transactions (id, country, state, amount, trans_date) values ('105', 'US', 'approved', '5000', '2019-06-15'); +Truncate table Chargebacks; +insert into Chargebacks (trans_id, trans_date) values ('102', '2019-05-29'); +insert into Chargebacks (trans_id, trans_date) values ('101', '2019-06-30'); +insert into Chargebacks (trans_id, trans_date) values ('105', '2019-09-18'); diff --git a/problems/product-sales-analysis-iii/README.md b/problems/product-sales-analysis-iii/README.md index eee9db960..db1531122 100644 --- a/problems/product-sales-analysis-iii/README.md +++ b/problems/product-sales-analysis-iii/README.md @@ -9,6 +9,6 @@ ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ [Next >](https://github.com/openset/leetcode/tree/master/problems/greatest-common-divisor-of-strings "Greatest Common Divisor of Strings") -## [1070. Product Sales Analysis III (Medium)](https://leetcode.com/problems/product-sales-analysis-iii "") +## [1070. Product Sales Analysis III (Medium)](https://leetcode.com/problems/product-sales-analysis-iii "ไบงๅ“้”€ๅ”ฎๅˆ†ๆž III") diff --git a/problems/sort-items-by-groups-respecting-dependencies/README.md b/problems/sort-items-by-groups-respecting-dependencies/README.md index 236183459..764871cb9 100644 --- a/problems/sort-items-by-groups-respecting-dependencies/README.md +++ b/problems/sort-items-by-groups-respecting-dependencies/README.md @@ -57,6 +57,7 @@ ### Related Topics [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[Graph](https://github.com/openset/leetcode/tree/master/tag/graph/README.md)] + [[Topological Sort](https://github.com/openset/leetcode/tree/master/tag/topological-sort/README.md)] ### Hints
    diff --git a/readme/301-600.md b/readme/301-600.md index 4ef6cb488..951a9b01b 100644 --- a/readme/301-600.md +++ b/readme/301-600.md @@ -311,7 +311,7 @@ LeetCode Problems' Solutions | 547 | [Friend Circles](https://leetcode.com/problems/friend-circles "ๆœ‹ๅ‹ๅœˆ") | [Go](https://github.com/openset/leetcode/tree/master/problems/friend-circles) | Medium | | 548 | [Split Array with Equal Sum](https://leetcode.com/problems/split-array-with-equal-sum "ๅฐ†ๆ•ฐ็ป„ๅˆ†ๅ‰ฒๆˆๅ’Œ็›ธ็ญ‰็š„ๅญๆ•ฐ็ป„") ๐Ÿ”’ | [Go](https://github.com/openset/leetcode/tree/master/problems/split-array-with-equal-sum) | Medium | | 549 | [Binary Tree Longest Consecutive Sequence II](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence-ii "ไบŒๅ‰ๆ ‘ไธญๆœ€้•ฟ็š„่ฟž็ปญๅบๅˆ—") ๐Ÿ”’ | [Go](https://github.com/openset/leetcode/tree/master/problems/binary-tree-longest-consecutive-sequence-ii) | Medium | -| 550 | [Game Play Analysis IV](https://leetcode.com/problems/game-play-analysis-iv) ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-iv) | Medium | +| 550 | [Game Play Analysis IV](https://leetcode.com/problems/game-play-analysis-iv "ๆธธๆˆ็Žฉๆณ•ๅˆ†ๆž IV") ๐Ÿ”’ | [MySQL](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-iv) | Medium | | 551 | [Student Attendance Record I](https://leetcode.com/problems/student-attendance-record-i "ๅญฆ็”Ÿๅ‡บๅ‹ค่ฎฐๅฝ• I") | [Go](https://github.com/openset/leetcode/tree/master/problems/student-attendance-record-i) | Easy | | 552 | [Student Attendance Record II](https://leetcode.com/problems/student-attendance-record-ii "ๅญฆ็”Ÿๅ‡บๅ‹ค่ฎฐๅฝ• II") | [Go](https://github.com/openset/leetcode/tree/master/problems/student-attendance-record-ii) | Hard | | 553 | [Optimal Division](https://leetcode.com/problems/optimal-division "ๆœ€ไผ˜้™คๆณ•") | [Go](https://github.com/openset/leetcode/tree/master/problems/optimal-division) | Medium |