Domanda di colloquio di Cruise

Leetcode medium level dynamic programing question