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-19_01-41-26.png
31.8 KB
#N268. Missing Number
problem link

#solution
class Solution {
public int missingNumber(int[] nums) {
int count[]=new int[nums.length+1];

for(int num:nums)
count[num]++;

for(int i=0; i<count.length; i++){
if(count[i]==0)
return i;
}

return 0;
}
}