Pregunta de entrevista de Databricks

Three dynamic programming and backtracing problem