




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
This problem is closely related to finding the number of inversions in an array
if i know the position in which i will insert the i-th element in I can find the minimum cost to insert it