J.P. Morgan Interview Question

Question related to solve given problem