comefrom: <awangdev>Search Insert Position_2.java
code: public int searchInsert(ArrayList<Integer> A, int target) {
          int start = 0;
          int end = A.size() - 1;
          int mid;
          if (A == null || A.size() == 0 || target <= A.get(0)) {
              return 0; 
          }
          while (start + 1 < end) {
              mid = start + (end - start) / 2;
              if (A.get(mid) == target) {
                  return mid;
              } else if (A.get(mid) < target) {
                  start = mid;
              } else {
                  end = mid;
              } 
          }
          if (A.get(end) == target) {
              return end;
          }
          if (A.get(end) < target) {
              return end + 1;
          }
          if (A.get(start) == target) {
              return start;
          } 
          return start + 1;
          
      }
masked: public int sample_funcname ( ArrayList < Integer > var_2 , int var_3 ) {
    int var_5 = 0 ;
    int var_8 = var_2 . size ( ) - 1 ;
    int var_9 ;
    if ( var_2 == null || var_2 . size ( ) == 0 || var_3 <= var_2 . get ( 0 ) ) {
      return 0 ;
    }
    while ( var_5 + 1 < var_8 ) {
      var_9 = var_5 + ( var_8 - var_5 ) / 2 ;
      if ( var_2 . get ( var_9 ) == var_3 ) {
        return var_9 ;
      }
      else if ( var_2 . get ( var_9 ) < var_3 ) {
        var_5 = var_9 ;
      }
      else {
        var_8 = var_9 ;
      }
    }
    if ( var_2 . get ( var_8 ) == var_3 ) {
      return var_8 ;
    }
    if ( var_2 . get ( var_8 ) < var_3 ) {
      return var_8 + 1 ;
    }
    if ( var_2 . get ( var_5 ) == var_3 ) {
      return var_5 ;
    }
    return var_5 + 1 ;
  }
  