Валидатор не принимает решение, хотя вывод программы, соответствует условиям.
package com.javarush.task.jdk13.task06.task0632;
import java.io.IOException;
import java.util.Scanner;
/*
Пирамида
*/
public class Solution {
public static char[][] array;
public static void main(String[] args) throws IOException {
//напишите тут ваш код
Scanner scanner = new Scanner(System.in);
int high = scanner.nextInt();
array = new char[high][];
for (int i = 0; i < high; i++) {
array[i] = new char[high + i];
}
for (int i = 0; i < high; i++) {
int quantity = 1 + 2*i;
int widthOfLayer = array[i].length - 1;
for (int j = widthOfLayer; j >= 0; j--) {
if (j > widthOfLayer - quantity ) {
array[i][j] = '#';
}
else {
array[i][j] = ' ';
}
}
}
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
System.out.print(array[i][j]);
}
System.out.println();
}
}
}