题解 | #只出现一次的数字#

只出现一次的数字

https://www.nowcoder.com/practice/c04bd25f0396471b90dfc30d96b9109b

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param nums int整型一维数组 
 * @param numsLen int nums数组长度
 * @return int整型
 */
int singleNumber(int* nums, int numsLen ) {
    // write code here
    int result=  0;
    for(int i = 0;i<numsLen;i++)
    { 
        result^=nums[i];
    }
    return result;
}

全部评论

相关推荐

程序员小白条:这比例牛逼,750:1
点赞 评论 收藏
分享
每晚夜里独自颤抖:你cet6就cet6,cet4就cet4,你写个cet证书等是什么意思。专业技能快赶上项目行数,你做的这2个项目哪里能提现你有这么多技能呢
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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