J.P. Morgan Interview Question

Basic DSA questions were asked