PythiloMedium · 25 min · Task 53 of 100 · progress kept in this browser

Shortest positive-sum window

For positive integer values return the shortest contiguous subarray with sum at least target, or zero when impossible. target is positive.

window = [2, 3, 4]
target = 7
print(sum(window), sum(window[1:]))
Your task

For positive integer values return the shortest contiguous subarray with sum at least target, or zero when impossible. target is positive.