Every time i sublit my code it shows Runtime Error(NZEC).

I know NZEC mean is NON ZERO EXIT CODE,
but how i can remove it from my submission,
my code is …

import java.io.;
import java.util.
;
class Cake
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
for(int i=1;i<=t;i++)
{
int good=0;
String str[] = br.readLine().trim().split(" “);
int l = Integer.parseInt(str[0]);
int n = Integer.parseInt(str[1]);
int k = Integer.parseInt(str[2]);
int arr[]=new int[n];
String line[] = br.readLine().trim().split(” ");
for(int j=0;j<n;j++)
{
arr[j]=Integer.parseInt(str[j]);
}
Arrays.sort(arr);
if(arr[0]>=k)
good++;
if(l-arr[n-1]>=k)
good++;
for(int j=1;j<n;j++)
{
if(arr[j+1]-arr[j]>=k)
good++;
}
System.out.println(good);
}
}
}

format your code properly or save your code on ideone and paste the link here…

problem link ??

1 Like