Input: arr1[] = {2, 4, 6, 8, 10}, arr2[] = {4, 6}
Output: 1 1
Explanation:
Initially median is 6.
After removing 4, array becomes arr1[] = {2, 6, 8, 10}, median = 7, therefore the difference is 7 - 6 = 1.
After removing 6, array becomes arr1[] = {2, 8, 10}, median = 8, therefore the difference is 8 - 7 = 1.
Input: arr1[] = {1, 100, 250, 251}, arr2[] = {250, 1}
Output: -75 75.5
Explanation:
Initially median is 175.
After removing 250, array becomes arr1[] = {1, 100, 251}, median = 100, therefore the difference is 100 - 175 = -75.
After removing 1, array becomes arr1[] = {100, 251}, median = 175.5, therefore the difference is 175.5 - 100 = 75.5.