MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / singleNumber

Method singleNumber

C++/Single-Number-II.cpp:9–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7class Solution {
8public:
9 int singleNumber(vector<int>& nums) {
10 int a=0, b=0;
11 for(int num: nums) {
12 a = b & (a^num);
13 b = a | (b^num);
14 }
15 return b;
16 }
17};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected