This is a function problem. The input is already taken care of by the driver code. You only need to complete the function printClosest() that takes an array (arr), another array (brr), size of array arr (N), size of array brr (M), and return the array of two integers whose sum is closest to X. The driver code takes care of the printing.
Expected Time Complexity: O(N). Expected Auxiliary Space: O(1).