First stab:
def deflate(a)
a.inject([]){ |c,e| (Array === e ? (Array === e.first ? c.concat(e)
: c << e) : c << e); c }
end
Doesn't handle deeper nestings though.
--
[email protected] |
https://groups.google.com/d/forum/ruby-talk-google?hl=en
---
You received this message because you are subscribed to the Google Groups
"ruby-talk-google" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.