LeetCode题解(1122):数组的相对排序(Python) LeetCode的Python执行用时随缘,只要时间复杂度没有明显差异,执行用时一般都在同一个量级,仅作参考意义。 解法一(自定义排序): def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]: def helper(key): if key in arr2: return ...