I am not sure to understand what means the term "flattening" in programming languages. More precisely, what does it mean to "flatten a collection of collections"?
Does it means something like:
Collection< Collection< Object >>
--> Collection< Object >
?
This is some doc.
Also, this might be helpful:
[[1], 2, [[3,4], 5], [[[]]], [[[6]]], 7, 8, []] => [1, 2, 3, 4, 5, 6, 7, 8]
I think an informal definition would be "recursively get all the contents of the current collection and put all the contents into one single collection". Of course, the recursively could be ignored, in which case just one layer would be faltten.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With