We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3c875d commit acf4f3cCopy full SHA for acf4f3c
Single_Number.cc
@@ -0,0 +1,11 @@
1
+class Solution {
2
+public:
3
+ int singleNumber(int A[], int n) {
4
+ // Note: The Solution object is instantiated only once and is reused by each test case.
5
+ int ret = 0;
6
+ for (int i = 0; i < n; i++) {
7
+ ret ^= A[i];
8
+ }
9
+ return ret;
10
11
+};
0 commit comments