...

/

Challenge: Inversion Count in a List

Challenge: Inversion Count in a List

In this lesson, we will solve the problem of counting the number of inversions in a list.

What is inversion count?

Inversion count represents how far or close a list is from being sorted. If a list is sorted, the inversion count will be 0. But if it’s sorted in the reverse order, the inversion count will be maximum. ...