python arrows | 98% | simple ----with explanation
if len(points) == 0:
            return 0
        points.sort(key=lambda x : x[1])
        ans = 1
        lst = points[0][1]
        for pt in points:
            if pt[0] <= lst:
                continue
            else:
                ans += 1
                lst = pt[1]
        return ans

i first sorted the points based on there ending and then incremented the ans only when the point started after the lst

Comments (0)