• + 1 comment

    The solution is very much helpful!!But "x" has to lie between the max value in array a and min value in arra y b.hence the values of min and max could be int min=a[a.length-1] and int max = b[0];This will reduce the time for processing the code.