Skip to content

Instantly share code, notes, and snippets.

@Tustin
Created October 19, 2017 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tustin/5ca79ee2bdc981b3ce40cfbedbb54367 to your computer and use it in GitHub Desktop.
Save Tustin/5ca79ee2bdc981b3ce40cfbedbb54367 to your computer and use it in GitHub Desktop.
def zipper (arr1, arr2)
if !arr2.empty?
zipper(arr1.insert(arr1.size - 1, arr2.shift), arr2)
else
return arr1
end
end
a = [1,2]
b = [3,4,5]
puts("Result: " + zipper(a,b).to_s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment