Datadog interview question

Classical dynamic programing Smart linear interpolation (doesn't seem to exist in Leetcode)