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
Sounds like a variation on the Knapsack problem. You might find some inspiration in searching for those solutions.
How many intervals are we talking about? If it's only about 5 (as in your example), it' probably more practical to just try every combination. If it's more, will an approximation of an ideal solution do? Again, Knapsack solutions (such as George Dantzig's greedy approximation algorithm) might be a good place to start.