Sponsored
Use these hints if you're stuck. Try solving on your own first.
Using a hashmap, we can map the values of arr2 to their position in arr2.
After, we can use a custom sorting function.
Solve with full IDE support and test cases