Pregunta de entrevista de C3 AI

a dp problem which is somewhat diffucult