最小K少なくともKの最短サブアレイにおける合計と[LeetCode] 862最短サブアレイ



最短の、空でない、連続した部分配列の長さ戻り  A 少なくとも和とを  K

合計とは、空でない部分配列が存在しない場合は、少なくとも  K、返します  -1

例1:

Input: A = [1], K = 1
Output: 1

例2:

Input: A = [1,2], K = 4
Output: -1

例3:

Input: A = [2,-1,2], K = 3
Output: 3

注意:

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



Githubの同期住所:

https://github.com/grandyang/leetcode/issues/862



参考文献:

https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/



オールインワントピックのLeetCodeは(...更新)概要を説明します

おすすめ

転載: www.cnblogs.com/grandyang/p/11300071.html