题解 | #缺失数字#
缺失数字
http://www.nowcoder.com/practice/9ce534c8132b4e189fd3130519420cde
public class Solution {
public int solve (int[] a) { // write code here int count=0; for(int i=0;i<a.length;i++){ if(a[i]!=i) return i; } return a.length; }
}
缺失数字
http://www.nowcoder.com/practice/9ce534c8132b4e189fd3130519420cde
public class Solution {
public int solve (int[] a) { // write code here int count=0; for(int i=0;i<a.length;i++){ if(a[i]!=i) return i; } return a.length; }
}
相关推荐