Pergunta de entrevista da empresa Expedia Group

shuffling deck of cards

Resposta da entrevista

Sigiloso

31 de mai. de 2016

public static void shuffleDeckOfCards(){ int[] input = new int[52]; for (int i=0; i 0; i--){ Random r = new Random(); int random = r.nextInt(i); int number = input[random]; input[random] = input[i]; input[i] = number; } System.out.println(Arrays.toString(input)); } }