Problem doubt if you might be able to help

I was doing this problem on codechef
my solution is absolutely correct still it’s not getting accepted can your please check and help me

my solution

public static void main(String[] args) {

	Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
	int t = sc.nextInt();
	while(t-- > 0) {
	    int noOfPeople = sc.nextInt();
	    int[] points = new int[noOfPeople];
	    for(int i=0; i<noOfPeople; i++) {
				points[i] = sc.nextInt();
		}
	    int count=0;
		int min =  1;
		int max =  1;
		boolean result =true;
		for(int i =0; i<=points.length-2;i++) {
			if(Math.abs(points[i]-points[i+1]) >2) {		
				count=0;
				result = false;
			}
				
			else {
				count++;
				if(result)
					min++;
			}
		}
		System.out.println();
		
		if(count ==0)
			max = min;
		else
			max = max + count;
		
		 
		System.out.println(min+" "+max);
	}
}

@ishaanveerd,
The contest is still active hence I cannot give you the complete solution. What error are you getting? Is it wrong answer or a run time error?

don’t want solution I am running it on my eclipse it’s running perfectly fine even when I provide custom input same as given in problem it gives the correct solution

but when i run normally it gives error NZEC and i unable to find how i am getting that

@ishaanveerd,

  1. NZEC stands for Non Zero Exit Code.
  2. Exit codes are codes return by running program to operating system upon either succesful termination(Exit code 0) or termination due to error(Non zero exit code).
  3. In languages which have exception handling like Java, Python etc we can use exception hadling using try - catch blocks.
  4. NZEC is a runtime error.
  5. It mostly occurs when negative array index is accesed or the program which we have written takes up more space than the allocated memory for our program to run.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.