← Back to archive

Stdle #58 · slices · 2026-08-03

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, 1, 1)
a[0] = 1
b := append(a, 2)
a[0] = 50
fmt.Println(b[0])
}
Slices
4 attempts left

Answer & explanation