Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit 4504193

Browse files
committed
created solution for problem68
1 parent 16d4c14 commit 4504193

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

problem68/Solution.java

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

0 commit comments

Comments
 (0)