func Insert(array []int, element int, i int) []int {
return append(array[:i], append([]int{element}, array[i:]...)...)
}
func main() {
a := []int{10, 20, 30, 40}
a = Insert(a, 30, len(a))
fmt.Println(a)
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)