Pergunta de entrevista da empresa ThoughtSpot

A Binary Search Problem and a DP problem.