Pregunta de entrevista de Lyft

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