Skip to content

About

Recursion practice: flatten a nested list

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Flatten a List (Recursively)

Requirements

Write a recursive function that takes a multi-dimensional list, and returns a one-dimensional list. For the love of God, write some pseudocode before you code - and don't forget to write some tests!

Ex 1

input = [1, 2, [3], [4,5]]
output = [1, 2, 3, 4, 5]

Ex 2

input = [1, [2], [3, [4, 5, [6]]], 7]
output = [1, 2, 3, 4, 5, 6, 7]

Stuck? Have a code error? Use the "4 Before Me" debugging checklist to help you solve it!

About

Recursion practice: flatten a nested list

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages