Валидатор ругается, говорит, что не соблюдено 4 условие. При чëтном N числа должны выводиться в обратном порядке. Помогите пожалуйста, что я делаю не правильно?
package com.javarush.task.pro.task05.task0505;
import java.util.Scanner;
/*
Reverse
*/
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
if ((N > 0) && ((N % 2) != 0)){
int [] array = new int[N];
for (int i = 0; i < array.length; i++){
int L = sc.nextInt();
array[i] = L;
System.out.println(array[i]);
}
}
else if ((N > 0) && ((N % 2) == 0)){
int [] array = new int[N];
for (int i = N - 1; i >= 0; i--){
int M = sc.nextInt();
array[i] = M;
System.out.println(array[i]);
}
}
//напишите тут ваш код
}
}