src/main/java/com/leetcode/arrays/medium/ShuffleAnArray_384.java
public int[] shuffle() {
      int[] results = Arrays.copyOf(arr, arr.length);

      for (int i = 0; i < results.length; i++) {
        swap(results, i, randomBetween(i, arr.length));
      }
      return results;
    }
/** Returns a random shuffling of the array. */
Returns a random shuffling of the array.
Returns a random shuffling of the array .
public int[] shuffle() {
      int[] results = Arrays.copyOf(arr, arr.length);
      for (int i = 0; i < results.length; i++) {
        swap(results, i, randomBetween(i, arr.length));
      }
      return results;
    }
public int [ ] shuffle ( ) { int [ ] results = Arrays . copyOf ( arr , arr . length ) ; for ( int i = 0 ; i < results . length ; i ++ ) { swap ( results , i , randomBetween ( i , arr . length ) ) ; } return results ; }
Returns a random shuffling of the array.
Returns a random shuffling of the array .