Domanda di colloquio di Snowflake

A dynamic programming problem which is level 'hard' on leetcode