Show this error

/bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe

paste you code at

click on file->save->link will be generated
send the link of code generated
it will look like https://ide.codingblocks.com/s/258793

file is saved but i didnot get link

now my code is right but test case 2 getting wrong

how can i check your code is right or not

try again after saving code link will generated at top where url is written

No need to use array
Modified code
as contraints are very large you can;t store all elements into array

Constraints

N cannot be Negative. Range of Numbers can be between -1000000000 to 1000000000