J.P. Morgan Interview Question

I didn't have any problems