Question d’entretien chez Goldman Sachs

Write a program in o(n) complexity