✅Simple and Easy Solution🔥
Code\n\nclass Solution:\n    def minPatches(self, nums: List[int], n: int) -> int:\n        p = 0\n        x = 1\n        i = 0\n        \n        while x <= n:
# Code\n```\nclass Solution:\n    def minPatches(self, nums: List[int], n: int) -> int:\n        p = 0\n        x = 1\n        i = 0\n        \n        while x <= n:\n            if i < len(nums) and nums[i] <= x:\n                x += nums[i]\n                i += 1\n            else:\n                p += 1\n                x *= 2\n        \n        return p\n```
['Python3']