Accepted Python Quick Sort solution | Beats 93%
Have to compromise with space to knock off the leetcode acceptance. \nTime: O(NlogN)\nSpace: O(N^2)\n\n\nclass Solution:\n    def sortArray(self, nums: List[int
Have to compromise with space to knock off the leetcode acceptance. \nTime: O(NlogN)\nSpace: O(N^2)\n\n```\nclass Solution:\n    def sortArray(self, nums: List[int]) -> List[int]:\n        def quicksort(nums):\n            if len(nums) <= 1: return nums\n            \n            #picking a random pivot\n            pivot = random.choice(nums)\n            less_than, equal_to, greater_than = [], [], []\n            \n            for val in nums:\n                if val < pivot: less_than.append(val)\n                elif val > pivot: greater_than.append(val)\n                else: equal_to.append(val)\n            return quicksort(less_than) + equal_to + quicksort(greater_than)\n        return quicksort(nums)\n```
['Sorting', 'Python', 'Python3']