← Back to archive

Stdle #10 · slices · 2026-06-16

What does this Go snippet output?

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

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

Answer & explanation