A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-60.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6s:=[]int{1,2,3,4,5}
7a:=s[1:4]
8b:=a[1:2]
9b[0]=0
10fmt.Println(s)
11}
Slices
Answer & explanation
Console output
[1 2 0 4 5]
Why
Re-slicing never copies; every level shares the same backing array. a := s[1:4] offsets by 1, and b := a[1:2] offsets by another 1, so b[0] is s[2]. Writing 0 through b mutates that single shared cell, visible through s.