<qiyuangong>1539_Kth_Missing_Positive_Number_1.java
public int findKthPositive(int[] a, int k) {
        int B[] = new int[a.length];

        for (int i = 0; i < a.length; i++)
            B[i] = a[i] - i - 1; // -1 is done as here missing numbers start from 1 and not 0


        int lo = 0, hi = B.length - 1;

        while (lo <= hi) {
            int mid = lo + (hi - lo) / 2;

            if (B[mid] >= k)
                hi = mid - 1;
            else
                lo = mid + 1;
        }


        return lo + k;
    }
public int sample_funcname ( int [ ] var_0 , int var_1 ) {
  int var_3 [ ] = new int [ var_0 . length ] ;
  for ( int var_5 = 0 ;
  var_5 < var_0 . length ;
  var_5 ++ ) var_3 [ var_5 ] = var_0 [ var_5 ] - var_5 - 1 ;
  int var_8 = 0 , var_9 = var_3 . length - 1 ;
  while ( var_8 <= var_9 ) {
    int var_11 = var_8 + ( var_9 - var_8 ) / 2 ;
    if ( var_3 [ var_11 ] >= var_1 ) var_9 = var_11 - 1 ;
    else var_8 = var_11 + 1 ;
  }
  return var_8 + var_1 ;
}
