Question d’entretien chez Huawei Technologies

A leetcode medium question, dynamic programming.