aboutsummaryrefslogtreecommitdiff
path: root/2022/utils.rb
blob: ef1185ea4a78455ae8488bd820ddbfcd990cb3e0 (plain)
1
2
3
4
5
6
7
8
9
10
require 'pry'

class Array
  def each_n(n)
    while not self.empty?
      a, b, c = self.shift(n)
      yield [a, b, c]
    end
  end
end