Barclays Interview Question

How to write a function that takes an array of numbers and returns randomized array