Besonderhede van voorbeeld: -1531827226213993678

Metadata

Data

English[en]
Given a sorted positive integer array nums and an integer n , add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required.
Chinese[zh]
题目大意是给出一个已经按升序排列的由正整数组成的数组nums和一个正整数n,要求至少加入多少个数之后使得数组能通过相加形成[1,n]之间的所有数。

History

Your action: