I dont understannd. When I am putting the input A : [ 84, 2, 37, 3, 67, 82, 19,


#1

I dont understannd.
When I am putting the input
A : [ 84, 2, 37, 3, 67, 82, 19, 97, 91, 63, 27, 6, 13, 90, 63, 89, 100, 60, 47, 96, 54, 26, 64, 50, 71, 16, 6, 40, 84, 93, 67, 85, 16, 22, 60 ]
in custom Test I am getting correct answer as 290. But while I am testing it is telling that my function is returning 291. How is that possible?


#2

Iam facing same problem, did u solve the problem now?


#3

Global variables Boys! Set the returned variable equal to zero in the starting of the function/method.


#4

I had the same issue in Java when I had taken a global and static variable to store the inversions.
Apparently, I just had to reinitialize that variable to 0 in the main function which solved the issue.