Bottom-up iterative merge sort in Python
\nclass Solution(object):\n    def sortArray(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[int]\n        """\n        prev = [[
```\nclass Solution(object):\n    def sortArray(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[int]\n        """\n        prev = [[n] for n in nums]\n        while len(prev) > 1:\n            cur = []\n            for i in range(0, len(prev), 2):\n                cur.append(self.merge(prev[i], prev[i+1] if i+1<len(prev) else []))   \n            prev = cur\n        return prev[0]\n    \n            \n    def merge(self, l1, l2):\n        merged = []\n        i1 = i2 = 0\n        while i1 < len(l1) and i2 < len(l2):\n            if l1[i1] < l2[i2]:\n                merged.append(l1[i1])\n                i1 += 1\n            else:\n                merged.append(l2[i2])\n                i2 += 1\n        merged.extend(l1[i1:])\n        merged.extend(l2[i2:])\n        return merged\n```
['Merge Sort']