I don't know why it doesn't verify?
your help is much appreciated

package com.codegym.task.task20.task2025;
import java.util.*;
import java.io.*;
/*
Number algorithms
*/
public class Solution {
public static long[] getNumbers(long N) {
List<Long> longs = new ArrayList<>();
if (N <= 0) {
long[] result = {0L};
return result;
} else {
for (int i = 1; i < N; i++) {
String number = Integer.toString(i);
int digits = number.length();
long finalNum = 0;
for (int j = 0; j < digits; j++) {
long power = (long) Math.pow(Long.parseLong(String.valueOf(number.charAt(j))), digits);
finalNum += power;
}
if (finalNum == i) {
longs.add(finalNum);
}
}
long[] result = new long[longs.size()];
for (int i = 0; i < longs.size(); i++) {
result[i] = longs.get(i);
}
return result;
}
}
public static void main(String[] args) {
long a = System.currentTimeMillis();
System.out.println(Arrays.toString(getNumbers(1000)));
long b = System.currentTimeMillis();
System.out.println("memory " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / (8 * 1024));
System.out.println("time = " + (b - a) / 1000);
a = System.currentTimeMillis();
System.out.println(Arrays.toString(getNumbers(1000000)));
b = System.currentTimeMillis();
System.out.println("memory " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / (8 * 1024));
System.out.println("time = " + (b - a) / 1000);
}
}