hariprasadraja
10/1/2019 - 6:53 AM

go slice shuffling

using the Fisher–Yates algorithm, It shuffles the slice

 for i := len(a) - 1; i > 0; i-- {
    j := rand.Intn(i + 1)
    a[i], a[j] = a[j], a[i]
}