I'm starting to get a little tired of the stupid validations not passing. From where this thing is taking that the Solution class doesn't have two methods?
package com.codegym.task.task08.task0826;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
/*
Five winners
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
for (int i = 0; i < array.length; i++) {
array[i] = Integer.parseInt(reader.readLine());
}
sort(array);
System.out.println(array[0]);
System.out.println(array[1]);
System.out.println(array[2]);
System.out.println(array[3]);
System.out.println(array[4]);
}
public static void sort(int[] array) {
//write your code here
Integer[] tempArray = Arrays.stream(array).boxed().toArray(Integer[]::new);
Arrays.sort(tempArray, Collections.reverseOrder());
int i = 0;
for (int value :
tempArray) {
array[i++] = value;
}
}
}