J.P. Morgan interview question

I didn't have any problems