Non Zero Exit Code in Java
<p>Can anyone please specify where is my error.
As soon as i posted this on codechef it throws NZEC error.
Anyone has any idea why there is a Non Zero Exit Code error.</p>

<pre><code>import java.util.Scanner;


public class AlternatingSubarrayPrefix {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int t = scanner.nextInt();
    for (int i = 0; i &lt; t; i++) {
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int k = 0; k &lt; n; k++) {
            array[k] = scanner.nextInt();
        }
        int count = 0;
        int[] result = new int[n];
        for (int j = 0; j &lt; n-1 ; j++) {
            if(array[j] &lt; 0 &amp;&amp; array[j+1] &gt; 0 || array[j] &gt; 0 &amp;&amp; array[j+1] &lt; 0)
                result[j] = ++count;
            else {
                count = 1;
                result[j] = count;

            }   
        }
        if(array[n-1] &lt; 0 &amp;&amp; array[n-2] &gt; 0 || array[n-1] &gt; 0 &amp;&amp; array[n-2] &lt; 0)
            result[n-1] = ++count;
        else {
            count = 1;
            result[n-1] = count;
        }   
        for(int j = n-1; j &gt;=0; j--) 
            System.out.print(result[j] + " ");
    }
  }
}
</code></pre>