Guest User

Untitled

a guest
Jul 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. class Array
  2. def interleave(other)
  3. arr = []
  4. size.times { |i| arr << self[i]; arr << other[i] unless i + 1 > other.size }
  5. left = other[size - 1 .. -1]
  6. arr += left if left
  7. arr
  8. end
  9. end
Add Comment
Please, Sign In to add comment