When I run the program all is ok but verification didn’t pass. The verification said that it was too long.
Maybe any hint how to improve my solution?

package com.codegym.task.task20.task2025;
/*
Number algorithms
*/
import java.util.*;
public class Solution {
public static long[] getNumbers(long N) {
List<Long> arr = new ArrayList<Long>();
int wykladnik = String.valueOf(N).length();
if (wykladnik == 0) {
long[] result = null;
return result;
} else {
long[] result = new long[0];
long a = N;
int counter = 0;
long m = 0;
for (long s = 1; s < N; s++) {
m = s;
int dl = String.valueOf(s).length();
int[] pomoc = new int[dl];
long c = 0;
for (int i = 0; i < dl; i++) {
float b = m % 10;
pomoc[dl - 1 - i] = (int) b;
c = (long) s;
m /= 10;
}
long sum = 0;
for (int n : pomoc) {
sum = sum + (long) Math.pow((double) n, (double) dl);
}
// System.out.println(sum);
if (c == (long) sum) {
arr.add(counter, c);
counter++;
}
}
result = new long[arr.size()];
for (int z = 0; z < arr.size(); z++) {
result[z] = arr.get(z);
}
return result;
}
}
public static void main(String[] args) {
long[] ns = new long[]{8208L, 370L};
for (int i = 0; i < ns.length; i++) {
long N = ns[i];
System.out.println("Result for N = " + N);
System.out.println(Arrays.toString(Solution.getNumbers(N)));
} }
}