Skip to content

Commit 1effb0c

Browse files
committed
Remark and organize heap and greedy problems
1 parent de1d2b1 commit 1effb0c

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed

problems/greedy-problems.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
### 1.1 From Minimum or Maximum
88
| Problem | Difficulty |
99
|------------------|------------|
10-
|[945. Minimum Increment to Make Array Unique](../leetcode/945.minimum-increment-to-make-array-unique.md)|Medium (1448)|
10+
|@@[945. Minimum Increment to Make Array Unique](../leetcode/945.minimum-increment-to-make-array-unique.md)|Medium (1448)|
1111
|[1647. Minimum Deletions to Make Character Frequencies Unique](../leetcode/1647.minimum-deletions-to-make-character-frequencies-unique.md)|Medium (1509)|
12-
|[1509. Minimum Difference Between Largest and Smallest Value in Three Moves](../leetcode/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves.md)|Medium (1653)|
12+
|@@[1509. Minimum Difference Between Largest and Smallest Value in Three Moves](../leetcode/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves.md)|Medium (1653)|
1313
|[948. Bag of Tokens](../leetcode/948.bag-of-tokens.md)|Medium (1762)|
14-
|[1775. Equal Sum Arrays With Minimum Number of Operations](../leetcode/1775.equal-sum-arrays-with-minimum-number-of-operations.md)|Medium (1850)|
14+
|@@[1775. Equal Sum Arrays With Minimum Number of Operations](../leetcode/1775.equal-sum-arrays-with-minimum-number-of-operations.md)|Medium (1850)|
1515

1616
> https://leetcode.com/problems/maximum-bags-with-full-capacity-of-rocks/description/
1717
> https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/
@@ -23,7 +23,7 @@
2323
|[976. Largest Perimeter Triangle](https://leetcode.com/problems/largest-perimeter-triangle/description/)|Easy (1340)|
2424
|[561. Array Partition](https://leetcode.com/problems/array-partition-i/description/)|Easy|
2525
|[2592. Maximize Greatness of an Array](../leetcode/2592.maximize-greatness-of-an-array.md)|Medium (1569)|
26-
|[826. Most Profit Assigning Work](../leetcode/826.most-profit-assigning-work.md)|Medium (1708)|
26+
|@@[826. Most Profit Assigning Work](../leetcode/826.most-profit-assigning-work.md)|Medium (1708)|
2727

2828
> https://leetcode.com/problems/largest-perimeter-triangle/description // Not fully understand
2929
> https://leetcode.com/problems/maximize-greatness-of-an-array/ WA
@@ -32,7 +32,7 @@
3232
| Problem | Difficulty |
3333
|------------------|------------|
3434
|[1221. Split a String in Balanced Strings](https://leetcode.com/problems/split-a-string-in-balanced-strings/description/)|Easy (1219)|
35-
|[605. Can Place Flowers](../leetcode/605.can-place-flowers.md)|Easy|
35+
|@@[605. Can Place Flowers](../leetcode/605.can-place-flowers.md)|Easy|
3636
|[1529. Minimum Suffix Flips](../leetcode/1529.minimum-suffix-flips.md)|Medium (1392)|
3737
|[861. Score After Flipping Matrix](../leetcode/861.score-after-flipping-matrix.md)|Medium (1818)|
3838

@@ -41,24 +41,24 @@
4141
|------------------|------------|
4242
|[767. Reorganize String](../leetcode/767.reorganize-string.md)|Medium (1681)|
4343
|[984. String Without AAA or BBB](../leetcode/984.string-without-aaa-or-bbb.md)|Medium (1474)|
44-
|[1405. Longest Happy String](../leetcode/1405.longest-happy-string.md)|Medium (1820)|
45-
|[621. Task Scheduler](../leetcode/621.task-scheduler.md)|Medium|
44+
|**[1405. Longest Happy String](../leetcode/1405.longest-happy-string.md)**|Medium (1820)|
45+
|**[621. Task Scheduler](../leetcode/621.task-scheduler.md)**|Medium|
4646

4747
### To Categories
4848
> The following problems can be categorized into the other topics, such as heap, stack...etc.
4949
5050
| Problem | Difficulty |
5151
|------------------|------------|
52-
|[55. Jump Game](../leetcode/55.jump-game.md)|Medium|
53-
|[45. Jump Game II](../leetcode/45.jump-game-ii.md)|Medium|
52+
|**[55. Jump Game](../leetcode/55.jump-game.md)**|Medium|
53+
|**[45. Jump Game II](../leetcode/45.jump-game-ii.md)**|Medium|
5454
|[334. Increasing Triplet Subsequence](../leetcode/334.increasing-triplet-subsequence.md)|Medium|
55-
|[763. Partition Labels](../leetcode/763.partition-labels.md)|Medium|
55+
|**[763. Partition Labels](../leetcode/763.partition-labels.md)**|Medium|
5656
|[881. Boats to Save People](../leetcode/881.boats-to-save-people.md)|Medium|
57-
|[134. Gas Station](../leetcode/134.gas-station.md)|Medium|
58-
|[135. Candy](../leetcode/135.candy.md)|Hard|
57+
|**[134. Gas Station](../leetcode/134.gas-station.md)**|Medium|
58+
|**[135. Candy](../leetcode/135.candy.md)**|Hard|
5959
|[455. Assign Cookies](../leetcode/455.assign-cookies.md)|Easy|
6060
|[1541. Minimum Insertions to Balance a Parentheses String](../leetcode/1541.minimum-insertions-to-balance-a-parentheses-string.md)|Medium (1759)|
6161
|[1249. Minimum Remove to Make Valid Parentheses](../leetcode/1249.minimum-remove-to-make-valid-parentheses.md)|Medium (1657)|
6262
|[1963. Minimum Number of Swaps to Make the String Balanced](../leetcode/1963.minimum-number-of-swaps-to-make-the-string-balanced.md)|Medium (1688)|
63-
|[3397. Maximum Number of Distinct Elements After Operations](../leetcode/3397.maximum-number-of-distinct-elements-after-operations.md)|Medium (1687)|
63+
|@@[3397. Maximum Number of Distinct Elements After Operations](../leetcode/3397.maximum-number-of-distinct-elements-after-operations.md)|Medium (1687)|
6464
|[3413. Maximum Coins From K Consecutive Bags](../leetcode/3413.maximum-coins-from-k-consecutive-bags.md)|Medium (TODO)|

problems/heap-problems.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
### Basic
44
| Problem | Difficulty |
55
|------------------|------------|
6-
|[1046. Last Stone Weight](../leetcode/1046.last-stone-weight.md)|Easy (1172)|
6+
|**[1046. Last Stone Weight](../leetcode/1046.last-stone-weight.md)**|Easy (1172)|
77
|[1337. The K Weakest Rows in a Matrix](../leetcode/1337.the-k-weakest-rows-in-a-matrix.md)|Easy|
8-
|[2336. Smallest Number in Infinite Set](../leetcode/2336.smallest-number-in-infinite-set.md)|Easy|
8+
|@@[2336. Smallest Number in Infinite Set](../leetcode/2336.smallest-number-in-infinite-set.md)|Easy|
99
|[1845. Seat Reservation Manager](../leetcode/1845.seat-reservation-manager.md)|Medium|
1010
|[2462. Total Cost to Hire K Workers](../leetcode/2462.total-cost-to-hire-k-workers.md)|Medium (1763)|
11-
|[1834. Single-Threaded CPU](../leetcode/1834.single-threaded-cpu.md)|Medium (1797)|
12-
|[502. IPO](../leetcode/502.ipo.md)|Hard|
11+
|@@**[1834. Single-Threaded CPU](../leetcode/1834.single-threaded-cpu.md)**|Medium (1797)|
12+
|**[502. IPO](../leetcode/502.ipo.md)**|Hard|
1313

1414
> * https://leetcode.com/problems/trapping-rain-water-ii/description/ h
1515
> * https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended/description/ 2014
1616
> * https://leetcode.com/problems/construct-target-array-with-multiple-sums/description/ 2014 h
1717
> * https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/description/ h
1818
> * https://leetcode.com/problems/maximum-subsequence-score/description/ 2056
1919
> * https://leetcode.com/problems/maximum-performance-of-a-team/description/ 2091
20-
> * https://leetcode.com/problems/minimum-cost-to-hire-k-workers/description/ 2259
20+
> * **https://leetcode.com/problems/minimum-cost-to-hire-k-workers/description/** 2259
2121
>
2222
> * Solved: https://leetcode.com/problems/take-gifts-from-the-richest-pile/description/ 1276 // A very basic heap problem. `PriorityQueue(reverseOrder<Int>())` is used to create a max heap. 2024/10/28
2323
> * Solved: https://leetcode.com/problems/maximal-score-after-applying-k-operations/description/ 1386 // A very basic heap problem. 2024/10/29
@@ -36,45 +36,45 @@
3636

3737
| Problem | Difficulty |
3838
|------------------|------------|
39-
|[767. Reorganize String](../leetcode/767.reorganize-string.md)|Medium (1681)|
40-
|[984. String Without AAA or BBB](../leetcode/984.string-without-aaa-or-bbb.md)|Medium (1474)|
41-
|[1405. Longest Happy String](../leetcode/1405.longest-happy-string.md)|Medium (1820)|
42-
|[621. Task Scheduler](../leetcode/621.task-scheduler.md)|Medium|
39+
|@@**[767. Reorganize String](../leetcode/767.reorganize-string.md)**|Medium (1681)|
40+
|@@[984. String Without AAA or BBB](../leetcode/984.string-without-aaa-or-bbb.md)|Medium (1474)|
41+
|@@**[1405. Longest Happy String](../leetcode/1405.longest-happy-string.md)**|Medium (1820)|
42+
|@@**[621. Task Scheduler](../leetcode/621.task-scheduler.md)**|Medium|
4343

4444
> * https://leetcode.com/problems/distant-barcodes/description/ 1701
4545
4646
### Merge K Sorted
4747
| Problem | Difficulty |
4848
|------------------|------------|
49-
|[23. Merge k Sorted Lists](../leetcode/23.merge-k-sorted-lists.md)|Hard|
50-
|[264. Ugly Number II](../leetcode/264.ugly-number-ii.md)|Medium|
51-
|[373. Find K Pairs with Smallest Sums](../leetcode/373.find-k-pairs-with-smallest-sums.md)|Medium|
52-
|[378. Kth Smallest Element in a Sorted Matrix](../leetcode/378.kth-smallest-element-in-a-sorted-matrix.md)|Medium|
49+
|**[23. Merge k Sorted Lists](../leetcode/23.merge-k-sorted-lists.md)**|Hard|
50+
|**[264. Ugly Number II](../leetcode/264.ugly-number-ii.md)**|Medium|
51+
|@@**[373. Find K Pairs with Smallest Sums](../leetcode/373.find-k-pairs-with-smallest-sums.md)**|Medium|
52+
|**[378. Kth Smallest Element in a Sorted Matrix](../leetcode/378.kth-smallest-element-in-a-sorted-matrix.md)**|Medium|
5353

5454
> * https://leetcode.com/problems/super-ugly-number/description/ m
5555
> * https://leetcode.com/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/description/ 2133
5656
> * https://leetcode.com/problems/find-k-th-smallest-pair-distance/description/ h
57-
> * https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/description/ h
57+
> * **https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/description/** h
5858
> * ~~https://leetcode.com/problems/minimize-deviation-in-array/description/~~ 2533
5959
6060
### 事後諸葛
6161
| Problem | Difficulty |
6262
|------------------|------------|
63-
|[1642. Furthest Building You Can Reach](../leetcode/1642.furthest-building-you-can-reach.md)|Medium (1962)|
63+
|**[1642. Furthest Building You Can Reach](../leetcode/1642.furthest-building-you-can-reach.md)**|Medium (1962)|
6464

65-
> * https://leetcode.com/problems/course-schedule-iii/description/ h
66-
> * https://leetcode.com/problems/minimum-number-of-refueling-stops/description/ 2074
65+
> * **https://leetcode.com/problems/course-schedule-iii/description/** h
66+
> * **https://leetcode.com/problems/minimum-number-of-refueling-stops/description/** 2074
6767
6868
### Two Heaps
6969
| Problem | Difficulty |
7070
|------------------|------------|
71-
> * https://leetcode.com/problems/kth-largest-element-in-a-stream/ e
72-
> * https://leetcode.com/problems/find-median-from-data-stream/description/ h
73-
> * https://leetcode.com/problems/sliding-window-median/description/ h
71+
> * **https://leetcode.com/problems/kth-largest-element-in-a-stream/** e
72+
> * **https://leetcode.com/problems/find-median-from-data-stream/description/** h
73+
> * **https://leetcode.com/problems/sliding-window-median/description/** h
7474
7575
### Lazy Deletion
7676
| Problem | Difficulty |
7777
|------------------|------------|
7878
> * https://leetcode.com/problems/design-a-number-container-system/description/ 1540
7979
> * https://leetcode.com/problems/design-a-food-rating-system/description/ 1781
80-
> * https://leetcode.com/problems/stock-price-fluctuation/description/ 1831
80+
> * **https://leetcode.com/problems/stock-price-fluctuation/description/** 1831

problems/interval-problems.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
| Problem | Difficulty |
2626
|------------------|------------|
2727
> * https://leetcode.com/problems/maximum-length-of-pair-chain/description/ m
28-
> * https://leetcode.com/problems/non-overlapping-intervals/description/ 8k m
28+
> * **https://leetcode.com/problems/non-overlapping-intervals/description/** 8k m
2929
3030
### 2.2 区间分组
3131
| Problem | Difficulty |
3232
|------------------|------------|
3333
> * https://leetcode.com/problems/divide-intervals-into-minimum-number-of-groups 1713
34-
> * https://leetcode.com/problems/meeting-rooms-ii/ (Premium)
34+
> * **https://leetcode.com/problems/meeting-rooms-ii/** (Premium)
3535
3636
### 2.3 区间选点
3737
| Problem | Difficulty |
@@ -44,8 +44,8 @@
4444
|[55. Jump Game](../leetcode/55.jump-game.md)|Medium|
4545
|[45. Jump Game II](../leetcode/45.jump-game-ii.md)|Medium|
4646

47-
> * https://leetcode.com/problems/video-stitching/description/ 1746
48-
> * https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden/description/ 1885
47+
> * **https://leetcode.com/problems/video-stitching/description/** 1746
48+
> * **https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden/description/** 1885
4949
5050
### 2.6 其他区间贪心
5151
| Problem | Difficulty |

0 commit comments

Comments
 (0)