Determine the minimum number of patches to cover all sums from 1 to n.
Constraints
Example
>>> minPatches([1, 3], 6) 1 >>> minPatches([1, 5, 10], 20) 2 >>> minPatches([1, 2, 2], 5) 0 >>> minPatches([], 7) 3
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints