dsa1 min read
Jump Game VI — Greedy + Monotonic Deque
Maximum score to reach end where each jump is 1..k steps. Monotonic deque (sliding window maximum) of DP values for O(n) solution.
Read →
webcoderspeed.com
4 articles
Maximum score to reach end where each jump is 1..k steps. Monotonic deque (sliding window maximum) of DP values for O(n) solution.
Find longest subarray with sum <= k. Build prefix sums, use monotonic deque for decreasing prefix sums to efficiently find left boundaries.
Find the maximum in each sliding window of size k using a monotonic decreasing deque storing indices.
Maximize score jumping through an array with window k by combining DP with a monotonic decreasing deque.