Tibra interview question

leetcode medium dynamic programming task