Pergunta de entrevista da empresa GlobalLogic

Question from dynamic programming and data structure