Scanner.nextint Stream API Java
int[] numbers = IntStream.range(0, N).map(i -> scan.nextInt()).toArray();
coder
int[] numbers = IntStream.range(0, N).map(i -> scan.nextInt()).toArray();
int[] numbers = IntStream.generate(() -> scan.nextInt()).limit(N).toArray();