Skip to content

Instantly share code, notes, and snippets.

@deyindra
Created March 26, 2016 03:31
Show Gist options
  • Save deyindra/86b01aa4bc57daef110e to your computer and use it in GitHub Desktop.
Save deyindra/86b01aa4bc57daef110e to your computer and use it in GitHub Desktop.
Find Multiple Odd
public Set<Integer> findOddMultiple(int[] array){
Set<Integer> oddSet = new HashSet<>();
for(int val:array){
boolean status = oddSet.add(val);
if(!status){
oddSet.remove(val);
}
}
return oddSet;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment