Pregunta de entrevista de Amazon Web Services

2 hard question from leet code 1. greedy problem 2. dynamic programming