Pregunta de entrevista de Uber

random shuffle question from leetcode