Citadel Securities interview question

2 dynamic programming hackerank questions