Pergunta de entrevista da empresa Goldman Sachs

LC easy and debugging (fix some logical errors in the question)