Algorithm to find the maximum sum in a sequence of overlapping intervals

前端 未结 6 934
南旧
南旧 2020-11-30 19:33

The problem I am trying to solve has a list of intervals on the number line, each with a pre-defined score. I need to return the maximum possible total score.

The c

6条回答
  •  醉酒成梦
    2020-11-30 20:16

    Maybe an approach like in this answer could be used, which is O(n) at least for that problem. It would mean to iterate once through the intervals and keep track of just those interval combinations that still could lead to an optimal final solution.

提交回复
热议问题