Cruise Interview Question

Solve the live coding problem.