题解 | #缺失数字#

缺失数字

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;
}

}

全部评论

相关推荐

03-12 16:48
已编辑
门头沟学院 C++
不想加班的L:我第一次字节审批了一周,不过是有新的hr对接的,你这个看起来像是原来招聘的hr。第二次就一天审批就完了,比较快 可以参考一下
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务