Shortest run of positives reaching a total
Given a list nums of positive integers and a positive integer target, return the length of the shortest contiguous subarray whose sum is at least target. If no subarray reaches target (for example, when nums is empty), return 0.
Aim for O(n) time and O(1) extra space.
Besides the tests, one large input (6,000 values) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
shortest_run([3,1,4,1,5,9,2], 12)→2shortest_run([1,1,1,1], 5)→0shortest_run([2,4,1,3,2,5], 10)→3