Goldman Sachs Interview Question

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