Uber Interview Question

Big O notation