Pattern
Heap
A compact view of archive entries grouped by recurring technique.
44 entries
44 entries tagged as Heap.
02.02.2026
hard3013. Divide an Array Into Subarrays With Minimum Cost II
Min sum of k splits at max d distance window
23.01.2026
hard3510. Minimum Pair Removal to Sort Array II
Sort by removing min-sum pairs
27.12.2025
hard2402. Meeting Rooms III
Most frequent room 0..n for meetings [s,e]
18.07.2025
hard2163. Minimum Difference in Sums After Removal of Elements
Min first half - second half after removing n/3
11.07.2025
hard2402. Meeting Rooms III
Most frequent meeting room
7.07.2025
medium1353. Maximum Number of Events That Can Be Attended
Max attended events
22.05.2025
medium3362. Zero Array Transformation III
Max removed queries still zero-fy an array
08.05.2025
medium3342. Find Minimum Time to Reach Last Room II
Fastest travel in graph, alternating dt=1,2
02.04.2025
easy2873. Maximum Value of an Ordered Triplet I
Max (a[i] - a[j]) a[k]
28.03.2025
hard2503. Maximum Number of Points From Grid Queries
Running queries of increasing BFS
25.03.2025
medium3394. Check if Grid can be Cut into Sections
non-intersecting ranges on x or y axis sweep
24.03.2025
medium3169. Count Days Without Meetings
Days of non-intersecting intervals sweep
16.03.2025
medium2594. Minimum Time to Repair Cars
Min rank[i] count^2 to fix all cars search
13.02.2025
medium3066. Minimum Operations to Exceed Threshold Value II
Count nums += min(x,y) 2+max(x,y) < k
19.01.2025
hard407. Trapping Rain Water II
Trap the water in 2D height matrix
16.12.2024
easy3264. Final Array State After K Multiplication Operations I
Mutliply k minimums
15.12.2024
medium1792. Maximum Average Pass Ratio
Arrange passed students to improve average score
12.12.2024
medium2558. Take Gifts From the Richest Pile
Sum after k-Sqrt of tops in array
08.12.2024
medium2054. Two Best Non-Overlapping Events
Max two non-overlapping intervals search
17.11.2024
hard862. Shortest Subarray with Sum at Least K
Min subarray with sum at least k queue
14.11.2024
medium2064. Minimized Maximum of Products Distributed to Any Store
Min of max of quantities spread by n single-type stores search
22.10.2024
medium2583. Kth Largest Sum in a Binary Tree
kth largest level-sum in a tree
14.10.2024
medium2530. Maximal Score After Applying K Operations
Replace max(arr) with ceil(max/3) k times
13.10.2024
hard632. Smallest Range Covering Elements from K Lists
Smallest intersection of k sorted lists set
12.10.2024
medium2406. Divide Intervals Into Minimum Number of Groups
Count non-intersecting groups of intervals
11.10.2024
medium1942. The Number of the Smallest Unoccupied Chair
target's chair number when chairs reused by multiple [arrival, leave] times
18.08.2024
medium264. Ugly Number II
nth number with only [1,2,3,5] multipliers
12.08.2024
easy703. Kth Largest Element in a Stream
kth largest in a stream of values
04.08.2024
medium1508. Range Sum of Sorted Subarray Sums
Sum of [left..right] of sorted subarray's sums
25.07.2024
medium912. Sort an Array
Sort array using minimum memory
15.06.2024
hard502. IPO
Max capital by choosing k jobs with profits[] & capital[] given w on start
06.06.2024
medium846. Hand of Straights
Can array be split into consecutive groups
15.05.2024
medium2812. Find the Safest Path in a Grid
Safest path in a grid with thieves
11.05.2024
hard857. Minimum Cost to Hire K Workers
Min cost of k workers each doing quality[i] work for fair rate
10.05.2024
medium786. K-th Smallest Prime Fraction
kth arr[i]/arr[j], i < j, arr[i] < arr[j] search
09.05.2024
medium3075. Maximize Happiness of Selected Children
Sum of k maximums decreasing each step
08.05.2024
easy506. Relative Ranks
Convert results array to ranks array
15.11.2023
medium1846. Maximum Element After Decreasing and Rearranging
Max number from converting array to non decreasing
06.11.2023
medium1845. Seat Reservation Manager
Design reservation number system
21.10.2023
hard1425. Constrained Subsequence Sum
Max sum of subsequence i - j <= k
18.09.2023
easy1337. The K Weakest Rows in a Matrix
k indices with smallest row sum in a binary matrix
15.07.2023
hard1751. Maximum Number of Events That Can Be Attended II
Max sum of at most k values from non-intersecting array of (from, to, value) items
24.02.2023
hard1675. Minimize Deviation in Array
Use TreeSet to quickly access to the min and max elements.
23.02.2023
hard502. IPO
Sort items by increasing capital. Then, on each step, add all possible deals to the priority queue and take one best from it.