← Back to archive

Stdle #122 · iteration · 2026-10-06

What does this Ruby snippet output?

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

result = [5, 3, 8, 1, 9, 2].chunk_while { |a, b| a <= b }.to_a
puts result.inspect
Iteration
4 attempts left

Answer & explanation