Leetcode in Java && Oracle
419 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-11_21-35-59.png
23.6 KB
#N136. Single Number
problem link

#solution
class Solution {
public int singleNumber(int[] nums) {
int ans = 0;
int len = nums.length;
for(int i = 0; i != len; i++)
ans ^= nums[i];

return ans;

}
}

p.s. good problem to understand XOR operator better)