Why I AM GETTING RUN ERROR/?>

hello @dhruvilcodes
ur size of array is small thas why.
check the value of n from constraint section and decide the size of array accordingly.

1 Like

IF I DID A[1000000] THEN IT WILL SHOWING ALL ERROR

make all ur arrays(after correcting size) as global and then try.

if still give any issue then share ur updated code link with me.

1 Like

oh great it worked but why what it will differ by declaring global?
why my earlier code was not working and now working?

local array is stored on stack and global array is stored on data segment and becuase data segment has higher capcity than stack it worked.

1 Like

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.