title: Merge ordered Lists in Python without prior knowledge about the ordering function
body: <p>I am having a hard time to solve the following issue: I have to merge N lists. Each list contains some string objects. For each list, although I do not know which is the ordering function, I know that it is ordered. Moreover, the final list should respect all the ordering of the child that generated it. For instance:</p>
  <pre><code>l1 = ['This','world']
  l2 = ['This','is','a','world','!']
  l3 = ['a','hello','world']
  
  merged_list = merge_function(l1,l2,l3)
  </code></pre>
  <p>The results I would like to achieve is to receive a list containing</p>
  <pre><code>merged_list # ['This','is','a','hello','world','!']
  </code></pre>
  <p>But I cannot figure out the way to do it, as the lists are not following any rule beside the order in which the elements are provided. Any help would be appreciated.</p>
  <p>EDIT: The focus of my question is not on how to merge some lists. The problem is that the elements should be merged in a way that they respect all the ordering of the original lists.
  So I cannot use sets as they have their own ordering policy. I think I have to stick to lists because they are more flexible, but I need to find a way to insert new elements in the correct position within the final list, as I cannot simply append them.</p>
  <p>For instance:</p>
  <pre><code>l1 = ['This','world']
  l2 = ['This','is','a','world','!']
  merged_list = l1
  </code></pre>
  <p>If I then simply append the missing element to the merged_list I would obtain:</p>
  <pre><code>merged_list # ['This','world','is','a','!']
  </code></pre>
  <p>and this list breaks the ordering of l2. I hope now I explained the issue a bit better.</p>