← Back to archive

Stdle #134 · mutability · 2026-10-18

What does this Ruby snippet output?

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

h = Hash.new(0)
h[:a] += 1
h[:a] += 1
h[:b] += 1
puts h[:a]
puts h[:b]
puts h[:c]
Mutability
3 lines
4 attempts left

Answer & explanation