[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/Monika-R/LeetCode-Solutions/master/Python/patching-array.py [Back]  [Original]

# Time:  O(s + logn), s is the number of elements in the array
# Space: O(1)

class Solution(object):
    def minPatches(self, nums, n):
        """
        :type nums: List[int]
        :type n: int
        :rtype: int
        """
        patch, miss, i = 0, 1, 0
        while miss 

Web Proxy Viewer  |  New URL  |  Original Page