help me why use .start and .end not [0] and [1]


  • 0
    S

    why i use [0] or [1] to index the number is wrong, why .start and .end is right?

    intervals = sorted(intervals, key=lambda i: i[0])
    rinter = []
    for i in range(len(intervals)):
        if rinter and intervals[i][0] <= rinter[-1][1]:
            rinter[-1][1] = max(intervals[i][1], rinter[-1][1])
         else:
             rinter.append(intervals[i])
         return rinter
    

Log in to reply
 

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