Skip to content

Latest commit

 

History

History
100 lines (84 loc) · 6.42 KB

File metadata and controls

100 lines (84 loc) · 6.42 KB

Basic

Problem Difficulty Notes
1046. Last Stone Weight Easy (1172)
1337. The K Weakest Rows in a Matrix Easy
2336. Smallest Number in Infinite Set Easy
**1845. Seat Reservation Manager Medium Here is optimal heap solution.
2462. Total Cost to Hire K Workers Medium (1763)
**1834. Single-Threaded CPU Medium (1797) Sort by enqueueTime, heap tracks by processingTime.
502. IPO Hard Push affordable projects, heap tracks by profit.

Advanced

Problem Difficulty
857. Minimum Cost to Hire K Workers Hard (2259)

Top K

Problem Difficulty Notes
703. Kth Largest Element in a Stream Easy Streaming = Dynamic tracking.
**215. Kth Largest Element in an Array Medium Heap, quick select.
**347. Top K Frequent Elements Medium Bucket sort.
692. Top K Frequent Words Medium
451. Sort Characters By Frequency Medium
973. K Closest Points to Origin Medium
355. Design Twitter Medium

Rearrangement

Problem Difficulty Notes
**767. Reorganize String Medium (1681) Heap and greedy way (0, 2, 4, ... first, then 1, 3, 5, ... second).
984. String Without AAA or BBB Medium (1474) aab or bba, then ab or ba.
1405. Longest Happy String Medium (1820)
**621. Task Scheduler Medium

Merge K Sorted

Problem Difficulty Notes
23. Merge k Sorted Lists Hard One-by-one, divide and conquer, heap.
264. Ugly Number II Medium Push multiples (2, 3, 5), dedupe by set.
313. Super Ugly Number Medium
**373. Find K Pairs with Smallest Sums Medium
1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows Hard (2133)
378. Kth Smallest Element in a Sorted Matrix Medium

事後諸葛

Problem Difficulty
1642. Furthest Building You Can Reach Medium (1962)
871. Minimum Number of Refueling Stops Hard (2074)

Two Heaps

Problem Difficulty
**295. Find Median from Data Stream Hard

Lazy Deletion

Problem Difficulty
**3408. Design Task Manager Medium (1806)