leetcode

LeetCode: Single Number解题思路

题目描述

Single Number: 整数型数组中,每个元素均出现两次,除了一个元素例外,如何找出这个元素?能否设计一个线性时间的算法,且不需要额外的存储空间?

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?

继续阅读