Maximium and Minimum Question On A Segment of An Array (Merging Intervals)
Statement
Given a set of numbers find an optimal solution for a problem considering the current number and the best you can get from the left and right sides.
Approach
Find all optimal solutions for every interval and return the best possible answer.
The outer loop would be the possible length of the segment from 0 (base) to N (target).
Then using another loop determine one end of the interval, and inside the loop determining another end.
Finally, it might be an additional separator k (like leetcode 312) needs to deal with, or simply applying the DP Function
Related Questions
96. Unique Binary Search Trees Medium
1039. Minimum Score Triangulation of Polygon Medium
546. Remove Boxes Medium
1000. Minimum Cost to Merge Stones Hard
312. Burst Balloons Hard