Pregunta de entrevista de Huawei Technologies

A leetcode medium question, dynamic programming.