Infosys Interview Question

Based on Dynamic Programming and Graphs mainly.