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_0 , int var_1 ) {
    int var_2 = 0 ;
    int var_3 = var_0 . size ( ) - 1 ;
    int var_4 ;
    if ( var_0 == null || var_0 . size ( ) == 0 || var_1 <= var_0 . get ( 0 ) ) {
      return 0 ;
    }
    while ( var_2 + 1 < var_3 ) {
      var_4 = var_2 + ( var_3 - var_2 ) / 2 ;
      if ( var_0 . get ( var_4 ) == var_1 ) {
        return var_4 ;
      }
      else if ( var_0 . get ( var_4 ) < var_1 ) {
        var_2 = var_4 ;
      }
      else {
        var_3 = var_4 ;
      }
    }
    if ( var_0 . get ( var_3 ) == var_1 ) {
      return var_3 ;
    }
    if ( var_0 . get ( var_3 ) < var_1 ) {
      return var_3 + 1 ;
    }
    if ( var_0 . get ( var_2 ) == var_1 ) {
      return var_2 ;
    }
    return var_2 + 1 ;
  }
  