diff options
author | Matias Linares <matias@deprecated.org> | 2023-12-03 15:11:37 -0300 |
---|---|---|
committer | Matias Linares <matias@deprecated.org> | 2023-12-03 15:11:37 -0300 |
commit | d073dcaa66567e58d6f9a36b15c9e54b91ed8c54 (patch) | |
tree | b26480988df75847eba75892bdf33089ec08bcd7 /2022/utils.rb | |
parent | 129ac460f73972097700ad2def6b4c36d6ebe6e1 (diff) | |
download | advent-of-code-d073dcaa66567e58d6f9a36b15c9e54b91ed8c54.tar.gz |
Add 2022 and 2023
Diffstat (limited to '2022/utils.rb')
-rw-r--r-- | 2022/utils.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/2022/utils.rb b/2022/utils.rb new file mode 100644 index 0000000..ef1185e --- /dev/null +++ b/2022/utils.rb @@ -0,0 +1,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 |