Randomly rearranges the contents of an array.
Here is a implementation of Shuffle in kotlin:
fun <T:Comparable<T>>shuffle(items:MutableList<T>):List<T>{
val rg : Random = Random()
for (i in 0..items.size - 1) {
val randomPosition = rg.nextInt(items.size)
val tmp : T = items[i]
items[i] = items[randomPosition]
items[randomPosition] = tmp
}
return items
}