Shopee interview question

A dynamic programming leetcode problem