题目描述:
提交:
class Solution: def getStrongest(self, arr: List[int], k: int) -> List[int]: arr = sorted(arr) m = arr[(len(arr) - 1) // 2] res = [] tmp = sorted(arr, key=lambda x: (-abs(x - m),-x)) for i in tmp[:k]: res.append(i) return res
2023-12-27 18:36:27
题目描述:
提交:
class Solution: def getStrongest(self, arr: List[int], k: int) -> List[int]: arr = sorted(arr) m = arr[(len(arr) - 1) // 2] res = [] tmp = sorted(arr, key=lambda x: (-abs(x - m),-x)) for i in tmp[:k]: res.append(i) return res
下一篇:Redis主从配置