Question d’entretien chez Goldman Sachs

A coding question of leetcode medium difficulty