0
Insertion sort counter
Calculate the number of insertions necessary to do an insertion sort of an input vector containing positive integers.
Example:
Input:
[5, 2, 1, 6, 3, 4]
Sorting:
[1, 5, 2, 6, 3, 4]
[1, 2, 5, 6, 3, 4]
[1, 2, 3, 5, 6, 4]
[1, 2, 3, 4, 5, 6]
Output: 4
Test cases:
To be a...