Pregunta de entrevista de JPMorganChase

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