patching array
-
LeetCode - Patching ArrayAlgorithm 2021. 12. 10. 20:32
์๋ ํ์ธ์. ๊ทธ๋ฆฐ์ ๋๋ค๐ข ์ด๋ฒ ํฌ์คํ ์์๋ ์ค๋๋ง์ ์๊ณ ๋ฆฌ์ฆ์ ํ๋ ํ์ด๋ณผ๊นํฉ๋๋ค. ์ด๋ฒ์๋ LeetCode์์ Patching Array๋ผ๋ ๋ฌธ์ ๋ฅผ ํ์ด๋ดค์ด์! ๋ฌธ์ ์ ์ Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required. Example 1: Input: nums = [1,3], n = 6 Output: 1 Explanation: Com..