<awangdev>41. First Missing Positive_2.java
public int firstMissingPositive(int[] A) {
    	if (A == null || A.length == 0) {
    		return 1;
    	}
    	Arrays.sort(A);
    	int count = -1;
    	for (int i = 0; i < A.length; i++) {
    		if (A[i] > 0) {
    			if (count < 0) {
	    			count = A[i];
	    			if (count != 1) {
	    				return 1;
	    			}
    			} 
    			else if (A[i] == A[i - 1]) {
    				count--;
    			}
				else if(A[i] != count) {
					return count;
				}	
    			count++;
    		}
    	}
    	if (count < 0) {
    		return 1;
    	}
    	return count;
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 ) {
    return 1 ;
  }
  Arrays . sort ( var_0 ) ;
  int var_7 = - 1 ;
  for ( int var_8 = 0 ;
  var_8 < var_0 . length ;
  var_8 ++ ) {
    if ( var_0 [ var_8 ] > 0 ) {
      if ( var_7 < 0 ) {
        var_7 = var_0 [ var_8 ] ;
        if ( var_7 != 1 ) {
          return 1 ;
        }
      }
      else if ( var_0 [ var_8 ] == var_0 [ var_8 - 1 ] ) {
        var_7 -- ;
      }
      else if ( var_0 [ var_8 ] != var_7 ) {
        return var_7 ;
      }
      var_7 ++ ;
    }
  }
  if ( var_7 < 0 ) {
    return 1 ;
  }
  return var_7 ;
}
