Run error but one test case is working

One of this questions test case is correct but one is giving run error ??
uable to figure it out .

@S19APP-PP0082
Please share your code using ide.codingblocks.com .

@S19APP-PP0082
Your algo implementation is absolutely correct. Just increase your array size from 10^4 to 10^7 and your code will work fine.