Inversion count is giving output 4 instead of 8

Hey @shrutikatyal
The code u shared is of mergesort ,I can’t see any variable which is counting inversions in the above code.