Light Mode
Dark Mode
Why assert count_inversion((5, 3, 2, 1, 0)==10not2

Dear frends, could you help me with the following:

I do not understand why in an example in this task we have this statement: assert count_inversion((5, 3, 2, 1, 0)) == 10

Doest it really correct? Why it does not equal == 2 (not 10) I thougth that we need jest move 0 to first position and 5 to the last... And move 3 to position of 1

After two movements we have correct sequence ((0, 1, 2, 3, 5))

Where I mistaken?

Thank you

Created: Jan. 10, 2015, 12:03 p.m.
Updated: July 18, 2016, 8:10 a.m.
4
8
User avatar
subbotin