Pranav Parashar
Pranav Parashar
i will add the divide and conquer approach for counting inversions
i have added the cpp implementation. its fast and better for competitive programming.
my approach deals with checking the cycle using lightweight unionfind set data structure although @shashwatjolly has already done great work,but his and mine appraoches are quite different.
i will implement in cpp ,in a manner that will be very shorter to cod. This will help you for contests. All the Best :)