8 lines
185 B
Python
8 lines
185 B
Python
def flatten(l) -> list:
|
|
acc = []
|
|
for x in l:
|
|
if(isinstance(x, list)):
|
|
acc += flatten(x)
|
|
elif(x is not None):
|
|
acc.append(x)
|
|
return acc |