← Back to archive

Stdle #124 · iteration · 2026-10-08

What does this Ruby snippet output?

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

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

Answer & explanation