[LeetCode] Shortest Subarray with Sum at Least K

1 · · Feb. 22, 2022, 8:55 a.m.
862. Shortest Subarray with Sum at Least K Given an integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1. A subarray is a contiguous part of an array. ...