Skip to content

Instantly share code, notes, and snippets.

@zeraf29
Created January 11, 2019 08:11
Show Gist options
  • Select an option

  • Save zeraf29/69260e736577b198585ad0d8c732bc5b to your computer and use it in GitHub Desktop.

Select an option

Save zeraf29/69260e736577b198585ad0d8c732bc5b to your computer and use it in GitHub Desktop.
get count number
import java.util.Arrays;
import java.util.List;
import java.util.Collections;
import java.utils.Arrays;
public class FindOdd {
public static int findIt(int[] a) {
int odd = 0;
List<Integer> list = Arrays.asList(ArrayUtils.toObject(a));
for(int i : a){
if(Collections.frequency(list, i)%2>0){
odd = i;
break;
}
}
return odd;
}
}
@zeraf29

zeraf29 commented Jan 11, 2019

Copy link
Copy Markdown
Author

Need fix upper source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment