Last element of array 1 is not kth We can directly return the ( k - m ) th element in array 2
if ( arr1 [ m - 1 ] < arr2 [ st2 + curr - 1 ] ) return arr2 [ st2 + ( k - ( m - st1 ) - 1 ) ] ; else return kth ( arr1 , arr2 , m , n , k - curr , st1 , st2 + curr ) ; }