K Inverse Pairs Array

Can you solve this problem? 🤔