Guest User

Untitled

a guest
Apr 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. class Array
  2. def /(n)
  3. arr = []
  4. size = length / n
  5. size += 1 if length % n > 0
  6. n.times do |i|
  7. arr << self[i*size, size]
  8. end
  9. arr
  10. end
  11. end
Add Comment
Please, Sign In to add comment