Gowtham Gopalakrishnan 6 years ago committed by GitHub
parent cc26ad7dce
commit f333f2f6e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,9 @@ package utils
import "math/rand"
func RandArray(n int) []int {
// needed a seed input else it will generate the same number
rand.Seed(time.Now().UnixNano())
arr := make([]int, n)
for i := 0; i <= n - 1; i++ {
arr[i] = rand.Intn(n)

Loading…
Cancel
Save