Lyft interview question

TO Solve a coding question