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 cdc7a7f commit fbf80e3Copy full SHA for fbf80e3
src/singleNumber/singleNumber.java
@@ -0,0 +1,10 @@
1
+public class Solution {
2
+ public int singleNumber(int[] A) {
3
+ if (A == null || A.length == 0) { return 0; }
4
+ int num = A[0];
5
+ for (int i=1; i<A.length; i++) {
6
+ num ^= A[i];
7
+ }
8
+ return num;
9
10
+}
0 commit comments