Daily challenge for 2025-09-05
248. Relative Sort Array
Write a function solve that sorts arr1 according to the order defined by arr2. Elements present in arr2 appear first respecting the order of arr2, followed by the remaining elements in ascending order.
Example:Input: arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]Output: [2,2,2,1,4,3,3,9,6,7,19]
Run this challenge interactively in Python or JavaScript when the app loads.