Clean up--sigsegv

iam getting sigsegv error for this solution…https://www.codechef.com/viewsolution/33168232
and my question…https://www.codechef.com/problems/CLEANUP

You’re defining a 0-size array:

j=0,r[j]

then trying to write into it:

 r[j]=i;
 j++;

1 Like

thank you so much

1 Like