Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save daviddavis/1836074 to your computer and use it in GitHub Desktop.

Select an option

Save daviddavis/1836074 to your computer and use it in GitHub Desktop.
# Solution to 'The Curious Case of the Missing Method Part 3' on rubeque.com
# by david
# http://lh:3000/problems/the-curious-case-of-the-missing-method-part-3
a1 = [1, 2, 3]
a2 = [2, 3, 4]
b1 = ["durham", "bartow", "zwolle"]
b2 = ["nc", "fl", "nl"]
assert_equal a1.zip(a2), [[1, 2], [2, 3], [3, 4]]
assert_equal [10, 11, 12].zip(a1, a2), [[10, 1, 2], [11, 2, 3], [12, 3, 4]]
assert_equal b1.zip(b2), [["durham", "nc"], ["bartow", "fl"], ["zwolle", "nl"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment