All problems
MediumLists
Flatten a nested list
Flatten [[1,2],[3,4],[5]] into [1,2,3,4,5].
- #lists
- #nested
Sample input
[[1,2],[3,4],[5]]
Sample output
[1, 2, 3, 4, 5]
flatten-list.py
Output
Press "Run code" to execute.
Loading…
Flatten [[1,2],[3,4],[5]] into [1,2,3,4,5].
[[1,2],[3,4],[5]]
[1, 2, 3, 4, 5]
Press "Run code" to execute.