Skip to content

Commit 9f185bd

Browse files
committed
find unique element
1 parent 7a20833 commit 9f185bd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
public class TimeAndSpaceComplexityAnalysis_FindUniqueElement {
3+
4+
public static int findUnique(int[] arr) {
5+
//Your code goes here
6+
7+
int ans = 0;
8+
for(int i = 0; i<arr.length; i++){
9+
ans = ans ^ arr[i];
10+
}
11+
12+
return ans;
13+
}
14+
}

0 commit comments

Comments
 (0)