Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort 'arr2' and use binary search to get the closest element for each 'arr1[i]', it gives a time complexity of O(nlogn).
Solve with full IDE support and test cases