A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-86.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6a:=[]int{1,2}
7b:=[]int{3,4}
8c:=append(a,b...)
9fmt.Println(c)
10}
Slices
Answer & explanation
Console output
[1 2 3 4]
Why
The ... operator expands a slice into individual arguments, so append(a, b...) is equivalent to append(a, 3, 4). This concatenates the two slices, producing [1 2 3 4]. It is the standard way to join slices in Go.