def minPatches(self, nums, n):
        patch, miss, i = 0, 1, 0
        while miss <= n:
            if i < len(nums) and nums[i] <= miss:
                miss += nums[i]
                i += 1
            else:
                miss += miss
                patch += 1

        return patch
Validate a read preference.
dataset/ETHPy150Open kamyu104/LeetCode/Python/patching-array.py/Solution.minPatches--crossover with--dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/common.py/validate_read_preference