Uber Interview Question

Easy coding question. Hard case study