Помогите разобраться что не так в коде. Валидатор не принимает, пишет "Метод getNumbers должен возвращать массив чисел удовлетворяющих условию задачи."
package com.javarush.task.task20.task2025;
import java.text.SimpleDateFormat;
import java.util.*;
public class Solution {
private static List<Long> replica = new ArrayList<>();
public static void main(String[]args) {
long start = System.currentTimeMillis();
long[] array = getNumbers( 0);
long end = System.currentTimeMillis() - start;
long memore = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
SimpleDateFormat sdf = new SimpleDateFormat("ss.SSS");
System.out.println("Time = " + sdf.format(new Date(end)));
System.out.println("Memory = " + memore / 1048576);
System.out.println(Arrays.toString(array));
}
public static long[] getNumbers(long N) {
if(N < 1) {return null;}
int dN = (int) (Math.log10(N) + 1);
long[][] powArray = new long [10][dN + 1];
for(int i = 0; i < 10; i++) {
for(int j = 1; j <= dN + 1; j++) {
if(j == 1)
powArray[i][j - 1] = i;
else {
powArray[i][j - 1] = powArray[i][j - 2] * i;
}
}
}
for (long i = 1; i < N; i++)
{
if (isNumberUnique(i)) {
long a = i;
long sumOfPowers = 0;
long d = (int) (Math.log10(a) + 1);
long b = a % 10;
while (a >= 1) {
sumOfPowers += powArray[(int) b][(int) d - 1];
a /= 10;
b = a % 10;
}
if (i == sumOfPowers & i < N & !replica.contains(sumOfPowers)) {
replica.add(sumOfPowers);
} else {
a = sumOfPowers;
long number = 0;
d = (int) (Math.log10(a) + 1);
b = a % 10;
while (a >= 1) {
number += powArray[(int) b][(int) d - 1];
a /= 10;
b = a % 10;
}
if (number == sumOfPowers & number < N & !replica.contains(sumOfPowers)) {
replica.add(sumOfPowers);
}
}
}
}
long[] result = new long[replica.size()];
for (int i = 0; i < replica.size(); i++) {
result[i] = replica.get(i);
}
return result;
}
private static boolean isNumberUnique(long number) {
int lastDigit = 0;
int currentDigit;
while (number > 0) {
currentDigit = (int) (number % 10);
if (lastDigit < currentDigit & lastDigit != 0) {
return false;
}
lastDigit = currentDigit;
number /= 10;
}
return true;
}
}