You collect UPI payments during a sale. nums[i] is the amount, in rupees, of the i-th payment. All the amounts are positive.
You are also given a number target. Find the shortest group of payments that came one after another (a subarray) with a total of at least target. Return how many payments are in that group.
If no group reaches target, return 0.
Examples
Example 1:
Input: target = 10, nums = [3,4,2,6,1,5]
Output: 3
Explanation: The payments 4, 2 and 6 add up to 12. No group of 1 or 2 payments reaches 10.
Example 2:
Input: target = 8, nums = [9,1,1]
Output: 1
Explanation: The first payment alone (9) is already at least 8.
Example 3:
Input: target = 20, nums = [3,3,3]
Output: 0
Explanation: All the payments together give only 9, which is less than 20.