josephferris / ruby-flatten-array-lc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ruby: Flatten Arrays

#
#  1. Create a function to flatten the below array by one dimension
#
#    oneDimensionalArray = [1, [2, 3, [4, 5]]]
#
#
#  2. Create a function to flatten the below array n times.
#
#     nTimesArray = [1, [2, 3, [4, [5, 6]]]]
#
#
#  3. Create a function to flatten the below array using recursion.
#
#     arrayWithRecursion = [1, [2, 3, [4, [5, 6]]]]
#