@@ -0,0 +1,1751 @@
+%22%22%22Leetcode 1326. Minimum Number of Taps to Open to Water a Garden%0AHard%0A%0AURL: https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden/%0A%0AThere is a one-dimensional garden on the x-axis. The garden starts at%0Athe point 0 and ends at the point n. (i.e The length of the garden is n).%0A%0AThere are n + 1 taps located at points %5B0, 1, ..., n%5D in the garden.%0A%0AGiven an integer n and an integer array ranges of length n + 1 where%0Aranges%5Bi%5D (0-indexed) means the i-th tap can water the area%0A%5Bi - ranges%5Bi%5D, i + ranges%5Bi%5D%5D if it was open.%0A%0AReturn the minimum number of taps that should be open to water the whole%0Agarden, If the garden cannot be watered return -1.%0A%0AExample 1:%0AInput: n = 5, ranges = %5B3,4,1,1,0,0%5D%0AOutput: 1%0AExplanation: The tap at point 0 can cover the interval %5B-3,3%5D%0AThe tap at point 1 can cover the interval %5B-3,5%5D%0AThe tap at point 2 can cover the interval %5B1,3%5D%0AThe tap at point 3 can cover the interval %5B2,4%5D%0AThe tap at point 4 can cover the interval %5B4,4%5D%0AThe tap at point 5 can cover the interval %5B5,5%5D%0AOpening Only the second tap will water the whole garden %5B0,5%5D%0A%0AExample 2:%0AInput: n = 3, ranges = %5B0,0,0,0%5D%0AOutput: -1%0AExplanation: Even if you activate all the four taps you cannot water%0Athe whole garden.%0A%0AExample 3:%0AInput: n = 7, ranges = %5B1,2,1,0,2,1,0,1%5D%0AOutput: 3%0A%0AExample 4:%0AInput: n = 8, ranges = %5B4,0,0,0,0,0,0,0,4%5D%0AOutput: 2%0A%0AExample 5:%0AInput: n = 8, ranges = %5B4,0,0,0,4,0,0,0,4%5D%0AOutput: 1%0A%0AConstraints:%0A- 1 %3C= n %3C= 10%5E4%0A- ranges.length == n + 1%0A- 0 %3C= ranges%5Bi%5D %3C= 100%0A%22%22%22%0A%0Aclass Solution(object):%0A    def minTaps(self, n, ranges):%0A        %22%22%22%0A        :type n: int%0A        :type ranges: List%5Bint%5D%0A        :rtype: int%0A        %22%22%22%0A        pass%0A%0A%0Adef main():%0A    pass%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add lc1326_minimum_number_of_taps_to_open_to_water_a_garden.py