Failing a test case

code link: https://onlinegdb.com/F6gfkBKAp

hi @akashagarwal1321
u have sent the code of inversion count…
refer my code -->

Sorry for that but now i have updated the link

sir, the code is doing good with test case 0 and 2 but it is failing at test case 1

hi @akashagarwal1321
there was just a small mistake…
u have made array of size 1000.

int arr[1000];

while, according to constraints 1<=N<=10^5
so just write

int arr[n];

ur code will work fine and pass all test cases…

1 Like

Yes sir i corrected still it is not passing the test case.

hi @akashagarwal1321
use long long int and remove that n < m condition… ur code will pass all test cases…
corrected code -->

1 Like

yes sir, i got it. sum,pages_Reading, e could cause overflow which was ignored by mistake.
Thank you so much.

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.