How does heapq.merge() sort a list even without generate the list?
heapq.merge()
Not sure if I stated clear. So, this is raised from the Super Ugly Number proble
It takes n already sorted iterables. It can then look at the smallest value in each of those and use that. The smallest one is always the first item, then the second item, then the third item, since they are each sorted.