Easy Python Solution 7 Line


  • 0
    class Solution(object):
        def findMinArrowShots(self, points):
            points.sort(key = lambda x: x[0])
            count = len(points)
            for i in range(len(points)-1):
                if points[i+1][0] <= points[i][1]:
                    points[i+1][0], points[i+1][1] = max(points[i+1][0], points[i][0]), min(points[i+1][1], points[i][1])
                    count -= 1
            return count

Log in to reply
 

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