Domanda di colloquio di Huawei Technologies

A leetcode medium question, dynamic programming.