LearnPy Hub
← Arena
IntermediateRating 1400

Shortest Long-Enough Stretch

Values are positive. Print the length of the shortest contiguous subarray with sum at least s, or 0 if none.

Input

n s, then n positive integers.

Output

A length.

Sample 1

Input
6 7
2 3 1 2 4 3
Output
2

Sample 2

Input
3 4
1 4 4
Output
1
solution.py
Output appears here
Shortest Long-Enough Stretch · Python Arena problem · LearnPy Hub