Oscar Health Interview Question

An array question. and the time complexity