Hi, I'm trying to solve card-tricks in the Golang track, setItem specifically:
func SetItem(slice []int, index, value int) []int {
if (index > len(slice) - 1) || (index < 0) {
append(slice,value)
} else {
slice[index] = value
}
return slice
}
I'm not sure what I'm doing wrong, I append the value to the slice if the index is out of bounds.
Thank you