Google Interview Question

graph question and dynamic programing question