Created
March 26, 2016 03:31
-
-
Save deyindra/86b01aa4bc57daef110e to your computer and use it in GitHub Desktop.
Find Multiple Odd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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