Skip to content

Instantly share code, notes, and snippets.

@rightgo09
Created February 16, 2015 08:38
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 rightgo09/66cbb699c7a028dfdb77 to your computer and use it in GitHub Desktop.
Save rightgo09/66cbb699c7a028dfdb77 to your computer and use it in GitHub Desktop.
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