leetcode862专题

LeetCode862. 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 -