GlobalLogic Interview Question

easy question based on graph