Segmentation fault


sir ,i am getting segmentation fault by this approach ,
but i have submitted the code using a different approach , please check my this code ,what is the problrm in it.

Hey @siddhant_samal
Declare both the arrays globally .
The max space u can allocate to array inside function is 10^6 and globally is 10^8 ,that why we can get segementation error sometimes when we create array of more than 10^6 inside functions :slight_smile:

If this resolves your query then please mark it as resolved :slight_smile:

NO ,sir not resolved

What happened…??

https://ide.codingblocks.com/s/359602 globally declared array but not yet resolved…can you please update the code

Hey @siddhant_samal
Soory checked some old code before :sweat_smile:
Here is ur updated code : https://ide.codingblocks.com/s/359662
If this resolved your query then please mark it as resolved :slight_smile: