Skip to content

Instantly share code, notes, and snippets.

@NeMO84
Created January 21, 2011 06:20
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 NeMO84/789319 to your computer and use it in GitHub Desktop.
Save NeMO84/789319 to your computer and use it in GitHub Desktop.
array1 = [1, 2, 3, 4]
array2 = %w{peter piper picked peppers}
array3 = []
# You need to write some code in this part
# to make the program output "Success"
array3 = array1.collect{|i| i.to_s}.zip(array2).flatten
if array3 == ['1', 'peter', '2', 'piper', '3', 'picked', '4', 'peppers']
puts "Success"
else
puts "Failed"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment