Created
February 15, 2012 14:29
-
-
Save daviddavis/1836153 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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