Domanda di colloquio di Amazon

Leetcode-medium/hard level question about dynamic programming.