If I have some list which has sublists, and that sublists also have sublists etc, how to flatten everything at one level? Let's assume that max sublist level is <= 10. I know how to do that for 2-3 levels by loops, but there must be some algorithm to achieve this without <= 10 for loops. All elements are different, but it does not matter.
L=[[a,b],[[c,d,[e,f]],[g,[[h],i],j,[k,l,m]]...] # start list
newL = [a,b,c,d,e,f,g,h,i,j,k,l,m] # resulted list