Skip to content

Commit 047e536

Browse files
committed
add SingleNumber
1 parent ce0d083 commit 047e536

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package net.kenyang.algorithm;
2+
3+
public class Solution {
4+
5+
public int singleNumber(int[] A) {
6+
int num = 0;
7+
for (int i = 0; i < A.length; i++) {
8+
num ^= A[i];
9+
}
10+
return num;
11+
}
12+
13+
}

0 commit comments

Comments
 (0)