Cruise interview question

C++ coding exercise