feat: 136_single_number
This commit is contained in:
parent
f560e933f4
commit
90cce31c8e
13
136_single_number/main.cpp
Normal file
13
136_single_number/main.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class Solution {
|
||||||
|
public:
|
||||||
|
int singleNumber(vector<int>& nums) {
|
||||||
|
int result = 0;
|
||||||
|
for (auto num : nums) {
|
||||||
|
result ^= num;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user