travis_commit
This commit is contained in:
@ -4,7 +4,8 @@ Deep flattens a list.
|
||||
|
||||
Use recursion. Use `list.extend()` with an empty array (`result`) and the spread function to flatten a list. Recursively flatten each element that is a list.
|
||||
|
||||
```python
|
||||
```python
|
||||
|
||||
def spread(arg):
|
||||
ret = []
|
||||
for i in arg:
|
||||
@ -18,6 +19,7 @@ def spread(arg):
|
||||
result = []
|
||||
result.extend(spread(list(map(lambda x : deep(x) if type(x) == list else x,arr))))
|
||||
return result
|
||||
|
||||
```
|
||||
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user