Last active
December 17, 2015 21:39
-
-
Save SteveBenner/5676579 to your computer and use it in GitHub Desktop.
Recursive zip
This file contains 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
# @param [Integer] n Number of times to call zip upon self | |
# @return [#zip] Self, after calling Array#zip upon self given number of times | |
def zipr(n = self.length) | |
r = self | |
n.times { r = r.zip } | |
r | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment