Domanda di colloquio di Intuit

Dynamic Programming question and sliding window question