Bloomberg interview question

dynamic programming