J.P. Morgan Interview Question

Coding assessment related to java