Python - Removing overlapping lists

后端 未结 5 1054
旧时难觅i
旧时难觅i 2020-12-03 14:54

Say I have a list of lists that has indexes [[start, end], [start1, end1], [start2, end2]].

Like for example :

[[0, 133], [78, 100], [25,

5条回答
  •  甜味超标
    2020-12-03 15:17

    1. ascending sort all items by length.

    2. add them to a segment tree and ignore overlapped items.

提交回复
热议问题