I have the same output and i did not change the main method but it still wont verify
package com.codegym.task.task29.task2913;
import java.util.Random;
/*
Replace recursion
*/
public class Solution {
private static int numberA;
private static int numberB;
public static String getAllNumbersBetween(int a, int b) {
String sb = "";
if (b > a) {
for (int j = a; j <= b; j++) {
int i = 1 * j + (a - 1);
sb += j + " ";
}
} else if (a > b) {
for (int j = a; j >= b; j--) {
int i = -1 * b + (a - b + 1) * 2 + 1;
sb += j + " ";
}
} else sb += a;
return sb.trim();
}
public static void main(String[] args) {
Random random = new Random();
numberA = random.nextInt() % 1_000;
numberB = random.nextInt() % 10_000;
System.out.println(getAllNumbersBetween(numberA, numberB));
System.out.println(getAllNumbersBetween(numberB, numberA));
}
}