Input: arr[] = {5, 9, 1, 8}, brr[] {10, 12, 7, 4, 2, 3}, K = 3
Output: 6
Explanation:
Possible pairs that satisfy the given conditions are: { (5, 10), (5, 12), (1, 10), (1, 12), (1, 7), (8, 12) }.
Therefore, the required output is 6.
Input: arr[] = {2, 10}, brr[] = {5, 7}, K = 2
Output: 2
Explanation:
Possible pairs that satisfy the given conditions are: { (2, 5), (2, 7) }.
Therefore, the required output is 2.