I want to flatten a list whatever the values of list are:
Example:
[1, 2, 1] --> [1, 2]
[[1, 2], [2, 1] --> [1, 2]
Now I have a code which have very cases depending of the type of the objects in the list (first example numbers, second example list).
Is there a universal solution?