|
3 | 3 | 
|
4 | 4 | [](./LICENSE.md)
|
5 | 5 | 
|
6 |
| - |
| 6 | + |
7 | 7 | [](https://saythanks.io/to/kamyu104)
|
8 | 8 | <br>
|
9 | 9 | 
|
|
13 | 13 | * Since free questions may be even mistakenly taken down by some companies, only solutions will be post on now.
|
14 | 14 | * There are new LeetCode questions every week. I'll keep updating for full summary and better solutions.
|
15 | 15 | * For more problem solutions, you can see my [LintCode](https://github.com/kamyu104/LintCode) repository.
|
16 |
| -* For more challenging problem solutions, you can also see my `GoogleCodeJam`, `FacebookHackerCup` repositories. |
| 16 | +* For more challenging problem solutions, you can also see my [GoogleCodeJam](https://github.com/kamyu104/GoogleCodeJam-2019), [FacebookHackerCup](https://github.com/kamyu104/FacebookHackerCup-2019) repositories. |
17 | 17 | * Hope you enjoy the journey of learning data structures and algorithms.
|
18 | 18 | * Notes: "🔒" means your subscription of [LeetCode premium membership](https://leetcode.com/subscribe/) is required for reading the question.
|
19 | 19 |
|
|
237 | 237 | 1267 | [Count Servers that Communicate](https://leetcode.com/problems/count-servers-that-communicate/) | [C++](./C++/count-servers-that-communicate.cpp) [Python](./Python/count-servers-that-communicate.py) | _O(m * n)_ | _O(m + n)_ | Medium ||
|
238 | 238 | 1275 | [Find Winner on a Tic Tac Toe Game](https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game/) | [C++](./C++/find-winner-on-a-tic-tac-toe-game.cpp) [Python](./Python/find-winner-on-a-tic-tac-toe-game.py) | _O(1)_ | _O(1)_ | Easy ||
|
239 | 239 | 1295 | [Find Numbers with Even Number of Digits](https://leetcode.com/problems/find-numbers-with-even-number-of-digits/) | [C++](./C++/find-numbers-with-even-number-of-digits.cpp) [Python](./Python/find-numbers-with-even-number-of-digits.py) | _O(nlog(logm))_ | _O(logm)_ | Easy ||
|
| 240 | +1299 | [Replace Elements with Greatest Element on Right Side](https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side/) | [C++](./C++/replace-elements-with-greatest-element-on-right-side.cpp) [Python](./Python/replace-elements-with-greatest-element-on-right-side.py) | _O(n)_ | _O(1)_ | Easy || |
| 241 | +1304 | [Find N Unique Integers Sum up to Zero](https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/) | [C++](./C++/find-n-unique-integers-sum-up-to-zero.cpp) [Python](./Python/find-n-unique-integers-sum-up-to-zero.py) | _O(n)_ | _O(1)_ | Easy || |
240 | 242 |
|
241 | 243 | ## String
|
242 | 244 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
719 | 721 | 1266| [Minimum Time Visiting All Points](https://leetcode.com/problems/minimum-time-visiting-all-points/) | [C++](./C++/minimum-time-visiting-all-points.cpp) [Python](./Python/minimum-time-visiting-all-points.py) | _O(n)_ | _O(1)_ | Easy | |
|
720 | 722 | 1276| [Number of Burgers with No Waste of Ingredients](https://leetcode.com/problems/number-of-burgers-with-no-waste-of-ingredients/) | [C++](./C++/number-of-burgers-with-no-waste-of-ingredients.cpp) [Python](./Python/number-of-burgers-with-no-waste-of-ingredients.py) | _O(1)_ | _O(1)_ | Medium | |
|
721 | 723 | 1281| [Subtract the Product and Sum of Digits of an Integer](https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/) | [C++](./C++/subtract-the-product-and-sum-of-digits-of-an-integer.cpp) [Python](./Python/subtract-the-product-and-sum-of-digits-of-an-integer.py) | _O(logn)_ | _O(1)_ | Easy | |
|
| 724 | +1300| [Sum of Mutated Array Closest to Target](https://leetcode.com/problems/sum-of-mutated-array-closest-to-target/) | [C++](./C++/sum-of-mutated-array-closest-to-target.cpp) [Python](./Python/sum-of-mutated-array-closest-to-target.py) | _O(nlogn)_ | _O(1)_ | Medium | | Binary Search |
722 | 725 |
|
723 | 726 | ## Sort
|
724 | 727 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
786 | 789 | 1213 | [Intersection of Three Sorted Arrays](https://leetcode.com/problems/intersection-of-three-sorted-arrays/) | [C++](./C++/intersection-of-three-sorted-arrays.cpp) [Python](./Python/intersection-of-three-sorted-arrays.py) | _O(n)_ | _O(1)_ | Easy |🔒|
|
787 | 790 | 1214 | [Two Sum BSTs](https://leetcode.com/problems/two-sum-bsts/) | [C++](./C++/two-sum-bsts.cpp) [Python](./Python/two-sum-bsts.py) | _O(n)_ | _O(n)_ | Medium |🔒| Stack |
|
788 | 791 | 1248| [Count Number of Nice Subarrays](https://leetcode.com/problems/count-number-of-nice-subarrays/) |[C++](./C++/count-number-of-nice-subarrays.cpp) [Python](./Python/count-number-of-nice-subarrays.py) | _O(n)_ | _O(k)_ | Medium | variant of [Subarrays with K Different Integers](https://leetcode.com/problems/subarrays-with-k-different-integers/) | Two Pointers, Sliding Window
|
| 792 | +1305 |[All Elements in Two Binary Search Trees](https://leetcode.com/problems/all-elements-in-two-binary-search-trees/)| [C++](./C++/all-elements-in-two-binary-search-trees.cpp) [Python](./Python/all-elements-in-two-binary-search-trees.py) | _O(n)_ | _O(h)_ | Medium || Stack | |
789 | 793 |
|
790 | 794 | ## Recursion
|
791 | 795 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
947 | 951 | 1291|[Sequential Digits](https://leetcode.com/problems/sequential-digits/)| [C++](./C++/sequential-digits.cpp) [Python](./Python/sequential-digits.py)| _O(1)_ | _O(1)_ | Medium | | |
|
948 | 952 | 1293|[Shortest Path in a Grid with Obstacles Elimination](https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/)| [C++](./C++/shortest-path-in-a-grid-with-obstacles-elimination.cpp) [Python](./Python/shortest-path-in-a-grid-with-obstacles-elimination.py)| _O(m * n * k)_ | _O(m * n)_ | Hard | | `A* Search Algorithm` |
|
949 | 953 | 1298|[Maximum Candies You Can Get from Boxes](https://leetcode.com/problems/maximum-candies-you-can-get-from-boxes/)| [C++](./C++/maximum-candies-you-can-get-from-boxes.cpp) [Python](./Python/maximum-candies-you-can-get-from-boxes.py)| _O(n^2)_ | _O(n)_ | Hard | | |
|
| 954 | +1302|[Deepest Leaves Sum](https://leetcode.com/problems/deepest-leaves-sum/)| [C++](./C++/deepest-leaves-sum.cpp) [Python](./Python/deepest-leaves-sum.py)| _O(n)_ | _O(w)_ | Medium | | | |
| 955 | +1306|[Jump Game III](https://leetcode.com/problems/jump-game-iii/)| [C++](./C++/jump-game-iii.cpp) [Python](./Python/jump-game-iii.py)| _O(n)_ | _O(n)_ | Medium | | | |
950 | 956 |
|
951 | 957 | ## Depth-First Search
|
952 | 958 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
1038 | 1044 | 1240| [Tiling a Rectangle with the Fewest Squares](https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares/) | [C++](./C++/tiling-a-rectangle-with-the-fewest-squares.cpp) [Python](./Python/tiling-a-rectangle-with-the-fewest-squares.py) | _O(n^2 * m^2 * m^(n * m))_ | _O(n * m)_ | Hard |||
|
1039 | 1045 | 1255| [Maximum Score Words Formed by Letters](https://leetcode.com/problems/maximum-score-words-formed-by-letters/) | [C++](./C++/maximum-score-words-formed-by-letters.cpp) [Python](./Python/maximum-score-words-formed-by-letters.py) | _O(n * 2^n)_ | _O(n)_ | Hard |||
|
1040 | 1046 | 1258| [Synonymous Sentences](https://leetcode.com/problems/synonymous-sentences/) | [C++](./C++/synonymous-sentences.cpp) [Python](./Python/synonymous-sentences.py) | _O(p * l * log(p * l))_ | _O(p * l)_ | Medium || Union Find |
|
| 1047 | +1307| [Verbal Arithmetic Puzzle](https://leetcode.com/problems/verbal-arithmetic-puzzle/) | [C++](./C++/verbal-arithmetic-puzzle.cpp) [Python](./Python/verbal-arithmetic-puzzle.py) | _O(10! * n * l)_ | _O(n * l)_ | Hard ||| |
1041 | 1048 |
|
1042 | 1049 | ## Dynamic Programming
|
1043 | 1050 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
1180 | 1187 | 1278 | [Palindrome Partitioning III](https://leetcode.com/problems/palindrome-partitioning-iii/) | [C++](./C++/palindrome-partitioning-iii.cpp) [Python](./Python/palindrome-partitioning-iii.py) | _O(k * n^2)_ | _O(n^2)_ | Hard | | |
|
1181 | 1188 | 1289 | [Minimum Falling Path Sum II](https://leetcode.com/problems/minimum-falling-path-sum-ii/) | [C++](./C++/minimum-falling-path-sum-ii.cpp) [Python](./Python/minimum-falling-path-sum-ii.py) | _O(m * n)_ | _O(1)_ | Hard | | |
|
1182 | 1189 | 1292 | [Maximum Side Length of a Square with Sum Less than or Equal to Threshold](https://leetcode.com/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/) | [C++](./C++/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.cpp) [Python](./Python/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.py) | _O(m * n * log(min(m, n)))_ | _O(m * n)_ | Medium | | Binary Search |
|
| 1190 | +1301 | [Number of Paths with Max Score](https://leetcode.com/problems/number-of-paths-with-max-score/) | [C++](./C++/number-of-paths-with-max-score.cpp) [Python](./Python/number-of-paths-with-max-score.py) | _O(n^2)_ | _O(n)_ | Hard | | | |
1183 | 1191 |
|
1184 | 1192 | ## Greedy
|
1185 | 1193 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
1382 | 1390 | 1280| [Students and Examinations](https://leetcode.com/problems/students-and-examinations/) | [MySQL](./MySQL/students-and-examinations.sql) | _O((m * n) * log(m * n))_ | _O(m * n)_ | Easy |🔒| |
|
1383 | 1391 | 1285| [Find the Start and End Number of Continuous Ranges](https://leetcode.com/problems/find-the-start-and-end-number-of-continuous-ranges/) | [MySQL](./MySQL/find-the-start-and-end-number-of-continuous-ranges.sql) | _O(n)_ | _O(n)_ | Medium |🔒| |
|
1384 | 1392 | 1294| [Weather Type in Each Country](https://leetcode.com/problems/weather-type-in-each-country/) | [MySQL](./MySQL/weather-type-in-each-country.sql) | _O(m + n)_ | _O(n)_ | Easy |🔒| |
|
| 1393 | +1303| [Find the Team Size](https://leetcode.com/problems/find-the-team-size/) | [MySQL](./MySQL/find-the-team-size.sql) | _O(n)_ | _O(n)_ | Easy |🔒| | |
1385 | 1394 |
|
1386 | 1395 | ## Shell Script
|
1387 | 1396 | | # | Title | Solution | Time | Space | Difficulty | Tag | Note|
|
|
0 commit comments