RosettaCodeData/Task/Flatten-a-list/00DESCRIPTION

12 lines
339 B
Text
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
;Task:
2019-09-12 10:33:56 -07:00
Write a function to flatten the nesting in an arbitrary [[wp:List (computing)|list]] of values.
2016-12-05 22:15:40 +01:00
Your program should work on the equivalent of this list:
[[1], 2, [[3, 4], 5], [[[]]], [[[6]]], 7, 8, []]
2013-04-10 21:29:02 -07:00
Where the correct result would be the list:
[1, 2, 3, 4, 5, 6, 7, 8]
2016-12-05 22:15:40 +01:00
;Related task:
*   [[Tree traversal]]
<br><br>