Pregunta de entrevista de Uber

Code secret santa

Respuesta de la entrevista

Anónimo

22 jun 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.