Zakon
BAN USER
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
public static ArrayList<Integer> getMissingNumbers(int[] array1, int[] array2) {
HashSet<Integer> set2 = new HashSet<Integer>();
for(int num:array2){
set2.add(num);
}
ArrayList<Integer> missingNumbers = new ArrayList<Integer>();
for(int num:array1){
if (set2.add(num)) {
missingNumbers.add(num);
}
}
return missingNumbers;
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
public static String replaceSpacesWithCrap(String someString, String crap){
- Zakon June 09, 2014return someString.replaceAll("\\s", crap); //crap="20"
}