Datadog Interview Question

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