Question d’entretien chez Uber

Code secret santa

Réponse à la question d'entretien

Utilisateur anonyme

22 juin 2016

Gist: Insert all the names in a vector. Use Fisher-Yates algo to shuffle the vector randomly in O(N) time. Now that the array is shuffles, for each i, (i-1)%n becomes it's secret Santa.