dsa2 min read
Minimum Number of Refueling Stops [Hard] — Greedy Max-Heap
Find the minimum refueling stops to reach target by greedily picking the largest fuel station passed so far whenever we run out.
Read →
webcoderspeed.com
1276 articles
Find the minimum refueling stops to reach target by greedily picking the largest fuel station passed so far whenever we run out.
Find the longest subarray of 1s after deleting exactly one element using a sliding window that tracks the count of zeros.
Find the maximum number of points on the same line using a slope-as-fraction HashMap for each anchor point.
Find the longest valid parentheses substring using a stack that tracks the last unmatched index as a base.
Find the shortest subarray that when sorted makes the whole array sorted, using a single linear scan tracking violated boundaries.