Unable to figure out why I am getting a runtime error SIG SEGV in funny marbles..

I used brute force in the question funny marbles in easy question…
My solutions is
I have tried pasting a code from some other guy and the code works with almost the same logic…
Can someone tell me why I am getting a Wrong answer.

Not sure about the wrong answer, but you’ll need to be careful with allocating about 10MB in the stack, … that’s a definite no no in C/C++.