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.
Segmentation fault
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 
If this resolves your query then please mark it as resolved 
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 
Here is ur updated code : https://ide.codingblocks.com/s/359662
If this resolved your query then please mark it as resolved 