How to find NZEC error ??

-> Why does this code gives NZEC??

Thank You

adding an exception handler which does nothing removes the nzec error

java example:

} catch (Exception e){}

actually i use to code in python where there is no such use of return 0 statement.
I have submitted many problems in Python.

Then its due to some exception trace your source code carefully

1 Like

my code is

import java.lang.
public class sum
public static void main (String[] args)throws Exception
{ r = new (new (;
System.out.println(“Enter the number”);
int i=Integer.parseInt(r.readLine());
int sum=0;
for(int j=1;j<i;j++)
} }

But it is not showing any runtime error! What are you talking about? See-

If n>100 in your code , it will give you NZEC error

you can declare your array z dynamically or declare it with max value of n

Due to brute force consuming lot of memory in recursion calls and overflowing the memory stack. Use map data structure and memoization.

Thank you so much, i tried the memoization and got an AC.

can anyone tell me t=why NZEC error is there