Google Interview Question

Questions involving graph theory and DP