Shortest Subarray With Sum At Least K

hard
1. You are given an array nums and an integer k.
2. Find the length of shortest non-empty contiguous subarray with sum at leads K.

Input Format

Input is managed for you

Output Format

Output is managed for you

Constraints

1. 1 <= nums.length <= 50000
2. -10^5 <= nums[i] <= 10^5
3. 1 <= k <= 10^9

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
5
84 -37 32 40 95
167
Output
3
Previous
Root To All Leaf Path In Binary Tree
Next
Finding Mk Average

Related Questions