Clean up--sigsegv

iam getting sigsegv error for this solution…CodeChef: Practical coding for everyone
and my question…CLEANUP Problem - CodeChef

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