Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nums); // Shuffle the array [1,2,3] and return its result. Any permutation of [1,2,3] must equally lik
按照random随机给出的index,进行两两交换,当然也存在与上一次一样的数组结果.官方还有一种ICompare的比较器,只是打乱顺序这个没用起来,不知道该怎么搞,╮(╯_╰)╭ public static List<T> SortRandom<T>(this List<T> collection) { for (int i = collection.Count - 1; i > 0; i--) { Random rand = new Random(); int