Problem 862 · Hard

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.

Open the interactive visualisation