Given a function that generates perfectly random integers between 1 and k, implement a shuffle of an array using only swaps such that each of the n! permutations is equally likely (Fisher-Yates shuffle). For testing, given an array and seed, output the shuffled array. Input: first line n, second line n integers, third line seed. Output: shuffled array.
Example 1:
Example 2:
Constraints:
1 <= n <= 10^4 0 <= arr[i] <= 10^9 0 <= seed <= 10^9
Tags:
