Shortest Subarray with Sum at Least K
Find the shortest contiguous block whose sum reaches a target, even when some values are negative. The visual maintains prefix sums and a monotonic queue of candidate start points.
Find the shortest contiguous block whose sum reaches a target, even when some values are negative. The visual maintains prefix sums and a monotonic queue of candidate start points.