DEV Community

Discussion on: Daily Challenge #194 - Spread Number

Collapse
nijeesh4all profile image
Nijeesh Joshy

GO

func main() {
    x := spreadNumber(10)
    fmt.Println(x)
}

func spreadNumber(n int) []int {
    ar := make([]int, n)
    for i := range ar {
        ar[i] = i + 1
    }
    return ar
}