Skip to content

Commit de1d2b1

Browse files
committed
Remark and organize stack & queue problems
1 parent 2b4bdb4 commit de1d2b1

File tree

5 files changed

+36
-35
lines changed

5 files changed

+36
-35
lines changed

leetcode/1094.car-pooling.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## [1094. Car Pooling](https://leetcode.com/problems/car-pooling)
1+
# [1094. Car Pooling](https://leetcode.com/problems/car-pooling)
22

3+
## Hash Table
34
We will decrease the capacity at `from` (pick up the passenger) and increase back the capacity at `to` (the passenger gets off). Or we will increase the passenger count at `from` and decrease the passenger count at `to`.
45

56
```js

problems/hash-table-problems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
|[535. Encode and Decode TinyURL](../leetcode/535.encode-and-decode-tinyurl.md)|Medium|
99
|**[380. Insert Delete GetRandom O(1)](../leetcode/380.insert-delete-getrandom-o1.md)**|Medium|
1010
|@@[381. Insert Delete GetRandom O(1) - Duplicates allowed](../leetcode/381.insert-delete-getrandom-o1-duplicates-allowed.md)|Hard|
11-
|[355. Design Twitter](../leetcode/355.design-twitter.md)|Medium|
11+
|@@[355. Design Twitter](../leetcode/355.design-twitter.md)|Medium|
1212
|[1396. Design Underground System](../leetcode/1396.design-underground-system.md)|Medium|
1313
|**[146. LRU Cache](../leetcode/146.lru-cache.md)**|Medium|
1414

problems/heap-problems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
|[692. Top K Frequent Words](../leetcode/692.top-k-frequent-words.md)|Medium|
3333
|[451. Sort Characters By Frequency](../leetcode/451.sort-charaters-by-frequency.md)|Medium|
3434
|[973. K Closest Points to Origin](../leetcode/973.k-closest-points-to-origin.md)|Medium|
35-
|[355. Design Twitter](../leetcode/355.design-twitter.md)|Medium|
35+
|@@[355. Design Twitter](../leetcode/355.design-twitter.md)|Medium|
3636

3737
| Problem | Difficulty |
3838
|------------------|------------|

problems/interval-problems.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
## Intervals
2-
### Basic
2+
### Line Sweep
33
| Problem | Difficulty |
44
|------------------|------------|
55
|**[56. Merge Intervals](../leetcode/56.merge-intervals.md)**|Medium|
66
|**[57. Insert Interval](../leetcode/57.insert-interval.md)**|Medium|
77
|**[986. Interval List Intersections](../leetcode/986.interval-list-intersections.md)**|Medium|
88
|**[729. My Calendar I](../leetcode/729.my-calendar-i.md)**|Medium|
9-
|[55. Jump Game](../leetcode/55.jump-game.md)|Medium|
109
|**[1094. Car Pooling](../leetcode/1094.car-pooling.md)**|Medium|
1110
|[2779. Maximum Beauty of an Array After Applying Operation](../leetcode/2779.maximum-beauty-of-an-array-after-applying-operation.md)|Medium (1638)|
1211

@@ -42,6 +41,7 @@
4241
### 2.4 区间覆盖
4342
| Problem | Difficulty |
4443
|------------------|------------|
44+
|[55. Jump Game](../leetcode/55.jump-game.md)|Medium|
4545
|[45. Jump Game II](../leetcode/45.jump-game-ii.md)|Medium|
4646

4747
> * https://leetcode.com/problems/video-stitching/description/ 1746

problems/stack-queue-problems.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
### Stack Basics
44
| Problem | Difficulty |
55
|------------------|------------|
6-
|[155. Min Stack](../leetcode/155.min-stack.md)|Easy|
6+
|**[155. Min Stack](../leetcode/155.min-stack.md)**|Easy|
77
|[232. Implement Queue using Stacks](../leetcode/232.implement-queue-using-stacks.md)|Easy|
88
|[225. Implement Stack using Queues](../leetcode/225.implement-stack-using-queues.md)|Easy|
99
|[1472. Design Browser History](../leetcode/1472.design-browser-history.md)|Medium (1453)|
10-
|[946. Validate Stack Sequences](../leetcode/946.validate-stack-sequences.md)|Medium (1461)|
10+
|**[946. Validate Stack Sequences](../leetcode/946.validate-stack-sequences.md)**|Medium (1461)|
1111
|[71. Simplify Path](../leetcode/71.simplify-path.md)|Medium|
12-
|[636. Exclusive Time of Functions](../leetcode/636.exclusive-time-of-functions.md)|Medium|
12+
|@@**[636. Exclusive Time of Functions](../leetcode/636.exclusive-time-of-functions.md)**|Medium|
1313

14-
> * https://leetcode.com/problems/maximum-frequency-stack/description/ h 2027
14+
> * **https://leetcode.com/problems/maximum-frequency-stack/description/** h 2027
1515
>
1616
> * Solved: https://leetcode.com/problems/build-an-array-with-stack-operations/description/ 1180
1717
> * Solved: https://leetcode.com/problems/design-a-stack-with-increment-operation/description/ 1285 // Using array + top pointer to simulate stack, should have very clear definition of the top pointer. 2024/10/21
@@ -21,55 +21,55 @@
2121
### Nested Structure
2222
| Problem | Difficulty |
2323
|------------------|------------|
24-
|[150. Evaluate Reverse Polish Notation](../leetcode/150.evaluate-reverse-polish-notation.md)|Medium|
25-
|[1190. Reverse Substrings Between Each Pair of Parentheses](../leetcode/1190.reverse-substrings-between-each-pair-of-parentheses.md)|Medium (1485)|
26-
|[394. Decode String](../leetcode/394.decode-string.md)|Medium|
27-
|[856. Score of Parentheses](../leetcode/856.score-of-parentheses.md)|Medium (1562)|
24+
|**[150. Evaluate Reverse Polish Notation](../leetcode/150.evaluate-reverse-polish-notation.md)**|Medium|
25+
|@@[1190. Reverse Substrings Between Each Pair of Parentheses](../leetcode/1190.reverse-substrings-between-each-pair-of-parentheses.md)|Medium (1485)|
26+
|**[394. Decode String](../leetcode/394.decode-string.md)**|Medium|
27+
|@@[856. Score of Parentheses](../leetcode/856.score-of-parentheses.md)|Medium (1562)|
2828
|[1106. Parsing A Boolean Expression](../leetcode/1106.parsing-a-boolean-expression.md)|Hard (1880)|
29-
|[227. Basic Calculator II](../leetcode/227.basic-calculator-ii.md)|Medium|
30-
|[224. Basic Calculator](../leetcode/224.basic-calculator.md)|Hard|
29+
|@@**[227. Basic Calculator II](../leetcode/227.basic-calculator-ii.md)**|Medium|
30+
|@@**[224. Basic Calculator](../leetcode/224.basic-calculator.md)**|Hard|
3131

32-
> * https://leetcode.com/problems/number-of-atoms/description/ h
32+
> * **https://leetcode.com/problems/number-of-atoms/description/** h
3333
3434
### Parentheses
3535
| Problem | Difficulty |
3636
|------------------|------------|
37-
|[20. Valid Parentheses](../leetcode/20.valid-parentheses.md)|Easy|
37+
|**[20. Valid Parentheses](../leetcode/20.valid-parentheses.md)**|Easy|
3838
|[1614. Maximum Nesting Depth of the Parentheses](../leetcode/1614.maximum-nesting-depth-of-the-parentheses.md)|Easy (1322)|
39-
|[1021. Remove Outermost Parentheses](../leetcode/1021.remove-outermost-parentheses.md)|Easy (1311)|
40-
|[921. Minimum Add to Make Parentheses Valid](../leetcode/921.minimum-add-to-make-parentheses-valid.md)|Medium (1242)|
41-
|[678. Valid Parenthesis String](../leetcode/678.valid-parenthesis-string.md)|Medium (1700)|
42-
|[1541. Minimum Insertions to Balance a Parentheses String](../leetcode/1541.minimum-insertions-to-balance-a-parentheses-string.md)|Medium (1759)|
43-
|[1249. Minimum Remove to Make Valid Parentheses](../leetcode/1249.minimum-remove-to-make-valid-parentheses.md)|Medium (1657)|
44-
|[1963. Minimum Number of Swaps to Make the String Balanced](../leetcode/1963.minimum-number-of-swaps-to-make-the-string-balanced.md)|Medium (1688)|
39+
|@@[1021. Remove Outermost Parentheses](../leetcode/1021.remove-outermost-parentheses.md)|Easy (1311)|
40+
|@@**[921. Minimum Add to Make Parentheses Valid](../leetcode/921.minimum-add-to-make-parentheses-valid.md)**|Medium (1242)|
41+
|@@**[678. Valid Parenthesis String](../leetcode/678.valid-parenthesis-string.md)**|Medium (1700)|
42+
|@@[1541. Minimum Insertions to Balance a Parentheses String](../leetcode/1541.minimum-insertions-to-balance-a-parentheses-string.md)|Medium (1759)|
43+
|**[1249. Minimum Remove to Make Valid Parentheses](../leetcode/1249.minimum-remove-to-make-valid-parentheses.md)**|Medium (1657)|
44+
|@@[1963. Minimum Number of Swaps to Make the String Balanced](../leetcode/1963.minimum-number-of-swaps-to-make-the-string-balanced.md)|Medium (1688)|
4545

46-
> * https://leetcode.com/problems/remove-invalid-parentheses/description/ h
46+
> * **https://leetcode.com/problems/remove-invalid-parentheses/description/** h
4747
4848
### Remove Adjacent Items
4949
| Problem | Difficulty |
5050
|------------------|------------|
51-
|[735. Asteroid Collision](../leetcode/735.asteroid-collision.md)|Medium|
51+
|**[735. Asteroid Collision](../leetcode/735.asteroid-collision.md)**|Medium|
5252
|[1047. Remove All Adjacent Duplicates In String](../leetcode/1047.remove-all-adjacent-duplicates-in-string.md)|Easy (1286)|
5353

5454
> * https://leetcode.com/problems/make-the-string-great/description/ 1344
5555
> * https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/description/ 1426
56-
> * https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/description/ 1541
56+
> * **https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/description/** 1541
5757
> * https://leetcode.com/problems/maximum-score-from-removing-substrings/description/ 1868
5858
> * Solved: https://leetcode.com/problems/minimum-string-length-after-removing-substrings 1282 // Easy to solve by stack and learned two pointers approach, 2024/10/30
5959
6060
### Monotonic Stack
6161
| Problem | Difficulty |
6262
|------------------|------------|
63-
|[496. Next Greater Element I](../leetcode/496.next-greater-element-i.md)|Easy|
63+
|**[496. Next Greater Element I](../leetcode/496.next-greater-element-i.md)**|Easy|
6464
|[503. Next Greater Element II](../leetcode/503.next-greater-element-ii.md)|Medium|
65-
|[739. Daily Temperatures](../leetcode/739.daily-temperatures.md)|Medium|
65+
|**[739. Daily Temperatures](../leetcode/739.daily-temperatures.md)**|Medium|
6666
|[901. Online Stock Span](../leetcode/901.online-stock-span.md)|Medium (1709)|
67-
|[402. Remove K Digits](../leetcode/402.remove-k-digits.md)|Medium (1800)|
68-
|[42. Trapping Rain Water](../leetcode/42.trapping-rain-water.md)|Hard|
67+
|@@[402. Remove K Digits](../leetcode/402.remove-k-digits.md)|Medium (1800)|
68+
|**[42. Trapping Rain Water](../leetcode/42.trapping-rain-water.md)**|Hard|
6969
|[907. Sum of Subarray Minimums](../leetcode/907.sum-of-subarray-minimums.md)|Medium (1976)|
7070
|[2104. Sum of Subarray Ranges](../leetcode/2104.sum-of-subarray-ranges.md)|Medium (2000)|
7171
|[316. Remove Duplicate Letters](../leetcode/316.remove-duplicate-letters.md)|Medium (2184?)|
72-
|[84. Largest Rectangle in Histogram](../leetcode/84.largest-rentangle-in-histogram.md)|Hard|
72+
|**[84. Largest Rectangle in Histogram](../leetcode/84.largest-rentangle-in-histogram.md)**|Hard|
7373
|[2866. Beautiful Towers II](../leetcode/2866.beautiful-towers-ii.md)|Medium (2071)|
7474

7575
> * https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/description/ 1212
@@ -78,25 +78,25 @@
7878
> * https://leetcode.com/problems/find-the-most-competitive-subsequence/description/ 1802
7979
> * https://leetcode.com/problems/longest-well-performing-interval/description/ 1908
8080
> * https://leetcode.com/problems/maximum-score-of-a-good-subarray/description/ 1945
81-
> * https://leetcode.com/problems/132-pattern/ 2000
81+
> * **https://leetcode.com/problems/132-pattern/** 2000
8282
> * https://leetcode.com/problems/maximum-subarray-min-product/description/ 2051
8383
> * https://leetcode.com/problems/maximal-rectangle/description/ h
8484
8585
### Queue Basics
8686
| Problem | Difficulty |
8787
|------------------|------------|
88-
|[622. Design Circular Queue](../leetcode/622.design-circular-queue.md)|Medium|
88+
|**[622. Design Circular Queue](../leetcode/622.design-circular-queue.md)**|Medium|
8989
|[1823. Find the Winner of the Circular Game](../leetcode/1823.find-the-winner-of-the-circular-game.md)|Medium|
9090

9191
> * https://leetcode.com/problems/number-of-recent-calls/description/ 1337
9292
> * https://leetcode.com/problems/reveal-cards-in-increasing-order/description/ 1686
9393
> * https://leetcode.com/problems/dota2-senate/description/ m
94-
> * https://leetcode.com/problems/design-circular-deque/description/ m
94+
> * **https://leetcode.com/problems/design-circular-deque/description/** m
9595
> * https://leetcode.com/problems/design-front-middle-back-queue/description/ m
9696
9797
### Monotonic Queue
9898
| Problem | Difficulty |
9999
|------------------|------------|
100-
|[239. Sliding Window Maximum](../leetcode/239.sliding-window-maximium.md)|Hard|
100+
|**[239. Sliding Window Maximum](../leetcode/239.sliding-window-maximium.md)**|Hard|
101101

102102
> * https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/description/ 1672

0 commit comments

Comments
 (0)