RosettaCodeData/Task/Variable-declaration-reset/Ruby/variable-declaration-reset-1.rb

11 lines
133 B
Ruby
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
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