'list of unique elements formed by concatenating permutations of the initial lists

I would like to combine several lists, each lists should be preserved up to a permutation.

Here is an example:

I would like to combine these lists

[[0, 7], [2, 4], [0, 1, 7], [0, 1, 4, 7]]

The output I would like to obtain is e.g. this list

 [2, 4, 0, 7, 1]

Or as Sembei Norimaki phrased the task:

the result must be a list of unique elements formed by concatenating permutations of the initial lists.

The solution is not unique, and it could be that there is not always a solution possible



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source