Uber Interview Question

Math generate numbers coding question