Short Python


  • 0
    D
    class Solution(object):
        def findMinArrowShots(self, points):
            """
            :type points: List[List[int]]
            :rtype: int
            """
            points.sort(key = lambda x: x[1])
            i, r = 0, 0
            while i < len(points):
                shoot = points[i][1]
                while i < len(points) and  points[i][0] <= shoot: i += 1
                r += 1
            return r

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.