Python 3 PriorityQueue solution
Since I didn\'t see the PriorityQuene implementation in python I would like to provide my implementation for python guys.\n\n#### PriorityQuene\nTime: O(nlogn +
Since I didn\'t see the PriorityQuene implementation in python I would like to provide my implementation for python guys.\n\n#### PriorityQuene\nTime: O(nlogn + nlogk) where n is `len(arr)`\nSpace: O(k)\n```python\nclass Solution:\n    def getStrongest(self, arr: List[int], k: int) -> List[int]:\n        arr.sort()\n        median = arr[(len(arr) - 1) // 2]\n        res = []\n        h = []\n        \n        for a in arr:\n            heapq.heappush(h, (abs(a-median), a))\n            if len(h) > k:\n                heapq.heappop(h)\n        \n        for _ in range(k):\n            res.append(heapq.heappop(h)[1])\n            \n        return res\n```\n\nOther solutions: \nSorted the second part: `O(nlogn + nlogn)`\nTwo pointer: `O(nlogn + n)`\n\nPlease let me know if there is any other better solution!\n\n\n\n\n\n
[]