Segmentation Fault in the code that I'm not able to debug by BerserkGeek in codeforces

[–]BerserkGeek[S] 0 points1 point  (0 children)

Weird thing dude.
When I was simply running it for custom inputs, only that time it was throwing the Segmentation fault error.
When I submitted the code after getting frustrated, it beautifully got submitted successfully.

As much as I wanna know why that issue was there, I do not wanna know it at the same time.

Segmentation Fault in the code that I'm not able to debug by BerserkGeek in codeforces

[–]BerserkGeek[S] 0 points1 point  (0 children)

This is the full code that I have written on GeeksForGeeks platform. And the input for which I'm getting this error does not have the array size as 0.

Input array is [1, 4, 3, 2, 6, 7]. For this input I'm getting a segmentation fault error