← Back to archive

Stdle #60 · slices · 2026-08-05

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
func main() {
s := []int{1, 2, 3, 4, 5}
a := s[1:4]
b := a[1:2]
b[0] = 0
fmt.Println(s)
}
Slices
4 attempts left

Answer & explanation