Причем, самое странное, что последние 2 условия якобы не выполняются, хотя прописаны изначально
package com.javarush.task.task08.task0822;
import java.io.IOException;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.*;
/*
Минимальное из N чисел
*/
public class Solution {
public static void main(String[] args) throws Exception {
List<Integer> integerList = getIntegerList();
System.out.println(getMinimum(integerList));
}
public static int getMinimum(List<Integer> array) {
ArrayList<Integer> sort = new ArrayList<>(array);
Collections.sort(sort);
return sort.get(0);
}
public static List<Integer> getIntegerList() throws IOException {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
ArrayList<Integer> list = new ArrayList<>(x);
scan.nextLine();
for (int i = 0; i < x; i++) {
list.add(scan.nextInt());
scan.nextLine();
}
return list;
}
}