Lyft interview question

remove the given C++ code bugs and warnings, solve some algorithm problems.