[SIGSEGV] Runs fine on local but online judge throws a SIGSEGV

I have a code which runs fine on my local compiler but when I try to execute the same code on the codechef console it throws me a segmentation fault. The Interesting thing is it runs fine when I give custom input and run it. The output is also fine. The problem arises only when I try to run it without the custom input.

any sort of help would be appreciated.

1 Like

Try various test cases. Check whether your code tries to access any index which isn’t valid. Or something similar.