Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] maxs(int[] input){
- int max = Integer.MIN_VALUE;
- int number = 0;
- for(int i:input){
- if(i > max){
- max = i;
- number = 1;
- }else if(i==max){
- number++;
- }
- }
- int[] ret = new int[number];
- Arrays.fill(ret, max);
- return ret;
- }
Add Comment
Please, Sign In to add comment