Example Input:
[1, 2, 3, 3, 3, 3, 3, 10, 15, 15, 18, 1, 100]
Output:
0 1 1 2 3 3 3 3 3 1 0 5 5 8 2 3 4