LeetcodeDay1 Singular number

Posted demomaster

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetcodeDay1 Singular number相关的知识,希望对你有一定的参考价值。

  开个贴记录leetcode刷题,每天刷三道easy两道medium,用python和c++做。今天第一天,加油!

  【题目】:

原题:Given an array of integers, every element appears twice except for one. Find that single one.

Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?

翻译:给定一个数组,里面全是整数,每个数字都重复两遍,只有一个没有重复,找到那个不重复的数字。

注意:时间复杂度为线性,并且不占用额外内存。

  链接:https://leetcode.com/problems/single-number/description/

  我的方法:

 

  

 


以上是关于LeetcodeDay1 Singular number的主要内容,如果未能解决你的问题,请参考以下文章