Domanda di colloquio di Coupang

coding question was related to dynamic programming