LeetCode-Single Number II
Posted petewell
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode-Single Number II相关的知识,希望对你有一定的参考价值。
Problem:
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?
思路
- 将数组A中每个整形的二进制 分散到一个32位数组A上求和,出现3次的在该位上的和肯定是3的倍数
1 |
public class |
原文:大专栏 LeetCode-Single Number II
以上是关于LeetCode-Single Number II的主要内容,如果未能解决你的问题,请参考以下文章