Segmentation fault in code

In this question of prime visits how to do i approach such question which involve large array size or large number of test cases such that it does not give segmentation fault.

hello @mahfoozhaque91

make array global if size is very large.

here in this problem u will need 10^6 size array which u can easily declare it without any issue.

pls refer this video editorial for clarity->

which video ? .

-> https://www.youtube.com/watch?v=8sniiDbfPK4

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.