https://codeanddebug.in/blog/count-inversions/