Infosys Interview Question

They gave 2 problems from DP and Graphs and asked to solve one in 45min