9

leetCode解题报告之SingleNumberI,II(知识点:位运算)

 3 years ago
source link: https://blog.csdn.net/ljphhj/article/details/21840199
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
leetCode解题报告之SingleNumberI,II(知识点:位运算)_快乐de胖虎-CSDN博客

由于两题是姐妹题,所以放在同一个博文里了!

题目1:

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?

题目2:

Given an array of integers, every element appears three times except for one. Find that single one.

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

不知道这个题目如何做分析和讲解,直接上AC代码,欢迎留言指点:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK