0

I have the following problem, transform the structure below

[[1], [2,3,4,5,6], [7,8,9]]

by getting items from nested lists, as a result

[1,2,3,4,5,6,7,8,9]

The simplest implementation can be written in the following iterative way:

tab = [[1], [2,3,4,5,6], [7,8,9]]
result = []

for x in tab:
    for y in x:
        result.append(y)

I wondering, how to implement following functionality in paradigms of functional programming (for example using map). Any ideas? Thank you in advance for your help

petezurich
  • 7,683
  • 8
  • 34
  • 51
Costy
  • 165
  • 2
  • 14

0 Answers0