RosettaCodeData/Task/Variable-declaration-reset/Ruby/variable-declaration-reset-1.rb
2026-04-30 12:34:36 -04:00

10 lines
133 B
Ruby

s = [1, 2, 2, 3, 4, 4, 5]
for i in 0..6
curr = s[i]
prev = prev
if i>0 and curr==prev then
puts i
end
prev = curr
end