Sobes.tech
Junior — Senior

Creating an array of unique random numbers

livecode

Task condition

Write a function uniqRandn that should return a slice of n distinct random integers.

import (
    "fmt"
    "math/rand"
)

func main() {
    fmt.Println(uniqRandn(10))
}

func uniqRandn(n int) []int {
    // ...
}