Relative Sort Array
Easy
Arrays
Array
Sorting
Hash Table
Sort arr1 by order defined in arr2. Elements not in arr2 go at end sorted.
Constraints
1 ≤ len ≤ 1000
Examples
Example 1:
Input: 2 3 1 3 2 4 6 7 9 2 19
2 1 4 3 9 6
Output: 2 2 2 1 4 3 3 9 6 7 19
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console