Problem Code : INVSMOD2
Page 7, Theorem 3 of https://cs.uwaterloo.ca/journals/JIS/VOL4/MARGOLIUS/inversions.pdf
TonyK comment on https://math.stackexchange.com/questions/11002/cn-p-even-or-odd
If you didn’t get the question even after visiting the above links during contest, here’s an easy Video Editorial.
PS : Stay tuned for more short editorials.