Python | Leetcode Python题解之第330题按要求补齐数组
题目: 题解: class Solution:def minPatches(self, nums: List[int], n: int) -> int:patches, x 0, 1length, index len(nums), 0while x < n:if index < length and nums[index] < x:x nums[index]index 1else:x << 1patches …
2025-06-08