Dostaje "wrong answer". Czy moge prosić o testy, których mój program nie przechodzi?
Testy z treści zadania dają dobre wyniki
import java.util.Scanner;
public class Main {
private static Scanner userInput;
public static void main(String[] args) {
userInput = new Scanner(System.in);
while(true) {
String rows = userInput.nextLine();
Integer colsCount = Integer.parseInt(rows);
if(colsCount == 0)
break;
String text = userInput.nextLine();
String result = "";
int colLength = text.length() / colsCount;
for(int i = 0; i < colsCount; i++) {
for(int j = 0; j < colLength; j++) {
if(j % 2 == 0) {
int charAt = j * colsCount;
charAt += i;
result += text.charAt(charAt);
System.out.println(charAt);
}
else {
int charAt = ((j + 1) * colsCount) - 1;
charAt -= i;
result += text.charAt(charAt);
System.out.println(charAt);
}
}
}
System.out.println(result);
}
}
}