Created
February 16, 2015 08:38
-
-
Save rightgo09/66cbb699c7a028dfdb77 to your computer and use it in GitHub Desktop.
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
arr = [11,12,13,14,15,16,17,18] | |
arr.partition{|a|a.odd?}.flatten.each{|c|puts c} | |
#=> 11 | |
#=> 13 | |
#=> 15 | |
#=> 17 | |
#=> 12 | |
#=> 14 | |
#=> 16 | |
#=> 18 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment