A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-140.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6m:=map[string]int{"a":1,"b":2}
7delete(m,"c")
8fmt.Println(len(m))
9}
Maps
Answer & explanation
Console output
2
Why
delete only removes a key if it is present; deleting "c", which is absent, does nothing. The two existing entries "a" and "b" remain, so len(m) is 2. (We print only len, never ranging the map, to stay deterministic.)