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
I think we can use this recursion...
S[i] denotes the score of each interval Interval[i] denotes all the intervals
S[i]
Interval[i]
ResMax[i] = max(ResMax[i-1] + S[i] //if i is included ,max(R[i-1],S[i]) )
I am not checked thoroughly but it should work i beleive.