https://www.lintcode.com/problem/521/?_from=cat
[bug]
what is bug?
[code]
public class Solution {
/**
* @param nums: an array of integers
* @return: the number of unique integers
*/
public int deduplication(int[] nums) {
// write your code here
Set<Integer> set = new HashSet<>();
int l= 0, r=0;
while(r<nums.length){
int num = nums[r];
if(!set.contains(num)){
set.add(num);
nums[l] = num;
l++;
}
r++;
}
return l+1;
}
}