Why i am getting segmentation fault in it?

Hey @lovely
u are using too much memory and stack is running out of memory
Allocate memory dynamically to arrays

but in the video prateek bhaiya did the same way

He is using integer arrays u are using long long arrays of same length
Stack size is 8MB
so he used 10^6 * 4Bytes for int * 2arrays ==8MB
But u are using 16 MB

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.