← Back to archive

Stdle #49 · slices · 2026-07-25

What does this Go snippet output?

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

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

Answer & explanation