Skip to content

Commit c1c37fd

Browse files
authored
Create 136.cpp
1 parent c8a98ac commit c1c37fd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

leetcode/cpp/Array/136.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public:
3+
int singleNumber(vector<int>& nums) {
4+
int ans = 0;
5+
for (int i =0;i<nums.size();i++)
6+
{
7+
ans ^= nums[i];
8+
}
9+
return ans;
10+
}
11+
};

0 commit comments

Comments
 (0)