题解 | #数组中未出现的最小正整数#
数组中未出现的最小正整数
http://www.nowcoder.com/practice/8cc4f31432724b1f88201f7b721aa391
简洁
public int minNumberdisappered (int[] arr) { // write code here int num = 0; int min = Integer.MAX_VALUE; for(int i:arr){ if(i>0) min = Math.min(min,i); } return min==1?arr.length+1:min-1; }