LECANDY runtime error

https://www.codechef.com/viewsolution/41999705
Hi.
The problem is Contest Page | CodeChef
Why am i getting sigsev?
How do i avoid it?

int n, c, a[n];

You’re initialising an array of size n before you know what n is.

2 Likes

Okay thank you I got it right now.

1 Like