Guest User

Untitled

a guest
Jan 16th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public static int[] maxs(int[] input){
  2. int max = Integer.MIN_VALUE;
  3. int number = 0;
  4. for(int i:input){
  5. if(i > max){
  6. max = i;
  7. number = 1;
  8. }else if(i==max){
  9. number++;
  10. }
  11. }
  12. int[] ret = new int[number];
  13. Arrays.fill(ret, max);
  14. return ret;
  15. }
Add Comment
Please, Sign In to add comment