Created
April 3, 2018 19:52
-
-
Save piousbox/7539a3da68fabe5b676a870196be17b7 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
def a b | |
result = [] | |
b.map do |c| | |
if c.class.name == 'Array' | |
result += a(c) | |
else | |
result.push c | |
end | |
end | |
return result | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment