1122. Relative Sort Array Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1122class Solution: def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]: pos = {x: i for i, x in enumerate(arr2)} return sorted(arr1, key=lambda x: pos.get(x, 1000 + x))