|
96 | 96 | | 280 | [Wiggle Sort](https://leetcode.com/problems/wiggle-sort/) | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/280_Wiggle_Sort.py) ♥ | 1. Sort and insert (n - 1) / 2 from tail to correct position, O(nlogn) and O(1)<br>2. Sort and swap(i, i + 1) from 1 to n - 1, O(nlogn)<br>3. Iteratively check order and reverse order, if not satisfied, then swap i with i + 1, O(n) | |
97 | 97 | | 286 | [Walls and Gates](https://leetcode.com/problems/walls-and-gates/) | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/286_Walls_and_Gates.py) | BFS with queue, O(mn) and O(mn) | |
98 | 98 | | 288 | [Unique Word Abbreviation](https://leetcode.com/problems/unique-word-abbreviation/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/288_Unique_Word_Abbreviation.py) | hash | |
| 99 | +| 293 | [Flip Game](https://leetcode.com/problems/flip-game/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/293_Flip_Game.py) | Python string slicing | |
| 100 | +| 294 | [Flip Game II](https://leetcode.com/problems/flip-game-ii/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/294_Flip_Game_II.py) | 1. Backtracking to ensure that next step is False, O(n!!) and O(n!!)<br>2. Backtracking with memo, O(n!!) and O(n!)<br>3. DP based on [Sprague-Grundy Function](https://discuss.leetcode.com/topic/27282/theory-matters-from-backtracking-128ms-to-dp-0ms) | |
99 | 101 | | 296 | [Best Meeting Point](https://leetcode.com/problems/best-meeting-point/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/296_Best_Meeting_Point.py) | Think hard about Manhattan Distance in 1D case. Sort and find mean, O(mnlogmn) and O(1) | |
100 | 102 | | 298 | [Binary Tree Longest Consecutive Sequence](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/298_Binary_Tree_Longest_Consecutive_Sequence.py) | Bottom-up or top-down recursion, O(n) and O(n) | |
101 | 103 | | 305 | [Number of Islands II](https://leetcode.com/problems/number-of-islands-ii/) | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/305_Number_of_Islands_II.py) | Quick union find with weights, O(nlogn) and O(n) | |
|
106 | 108 | | 346 | [Moving Average from Data Stream](https://leetcode.com/problems/moving-average-from-data-stream/) ♥ | |
107 | 109 | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/346_Moving_Average_from_Data_Stream.py) | fix-sized queue or dequeue, O(1) and O(n) | |
108 | 110 | | 351 | [Android Unlock Patterns](https://leetcode.com/problems/android-unlock-patterns/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/351_Android_Unlock_Patterns.py) | Backtracking, O(n!) and O(n) | |
109 | | -| 359 | [Logger Rate Limiter](https://leetcode.com/problems/logger-rate-limiter/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/359_Logger_Rate_Limiter.py) | 1. hash which stores the latest timestamp, O(1) and O(n)<br>2. Using Priority queue to remove older logs, O(n) and O(n)| |
| 111 | +| 359 | [Logger Rate Limiter](https://leetcode.com/problems/logger-rate-limiter/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/359_Logger_Rate_Limiter.py) | 1. hash which stores the latest timestamp, O(1) and O(n)<br>2. Using Priority queue to remove older logs, O(n) and O(n) | |
110 | 112 | | 368 | [Largest Divisible Subset](https://leetcode.com/problems/largest-divisible-subset/) | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/368_Largest_Divisible_Subset.py) | Sort and generate x subset with previous results, O(n^2) and O(n^2) | |
111 | 113 | | 370 | [Range Addition](https://leetcode.com/problems/range-addition/) ♥ | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/370_Range_Addition.py) | Interval problem with cumulative sums, O(n + k) and O(n) | |
112 | 114 | | 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [Python](https://github.com/qiyuangong/leetcode/blob/master/python/384_Shuffle_an_Array.py) | Fisher–Yates shuffle, O(n) and O(n) | |
|
0 commit comments