Airbnb Interview Question

Time complexity of my code, how would improve it?