07-18-2023, 10:36 PM
I have an array:
[1,2,3,4,5,6,7,8,9,0]
that I'd like to iterate 3 at a time, which produces
1,2,3 and 4,5,6 and 7,8,9 and 0
What's the best way to do this in Ruby?
[1,2,3,4,5,6,7,8,9,0]
that I'd like to iterate 3 at a time, which produces
1,2,3 and 4,5,6 and 7,8,9 and 0
What's the best way to do this in Ruby?