137. Single Number II

Given an array of integers, every element appearsthreetimes except for one. Find that single one.

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

这题理解起来比single number 3 简单些。 没个数都出现三次, 只有一个粗线一次。那找到每个位上的1 的值%3 != 0 就是这个值。32个位挨个找一遍。


137. Single Number II_第1张图片

你可能感兴趣的:(137. Single Number II)