Can someone please help? I have the correct output in the correct format, but It will not pass the 3rd condition.
package com.codegym.task.task07.task0721;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Min and max in arrays
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = 0;
int minimum = 0;
int[] nums = new int[20];
for (int i=0; i<20; i++){
nums [i] = Integer.parseInt(reader.readLine());
}
for (int i=0; i<20; i++){
if (nums[i]<minimum)
minimum = nums[i];
}
for (int i = 0; i<20; i++){
if (nums[i]>maximum)
maximum = nums[i];
}//write your code here
System.out.print(maximum + " " + minimum);
}
}