Question d’entretien chez JPMorganChase

two dynamic programming questions from leetcode. One easy and one medium