Skip to content

Latest commit

 

History

History
19 lines (18 loc) · 394 Bytes

README.md

File metadata and controls

19 lines (18 loc) · 394 Bytes

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]]]]
#