Pergunta de entrevista da empresa Showatech

They asked to solve the problem in dynamic programming