J.P. Morgan Interview Question

He asked me to explain the coding round question.