Write a function array_intersection(arr1, arr2) that returns a sorted list of elements common to both arrays (no duplicates in output).
Example:
Input: arr1 = [1, 2, 3, 4, 5], arr2 = [3, 4, 5, 6, 7]
Output: [3, 4, 5]
Constraints:
Test Cases
Test Case 1
Input:
[1, 2, 3, 4, 5], [3, 4, 5, 6, 7]Expected:
[3, 4, 5]Test Case 2
Input:
[1, 2, 3], [4, 5, 6]Expected:
[]Test Case 3
Input:
[1, 1, 2, 2], [2, 2, 3, 3]Expected:
[2]+ 2 hidden test cases