It says in the mission description:
If two elements have the same frequency, they should end up in the same order as the first appearance in the iterable.
then frequency_sort([4, 6, 2, 2, 6, 4, 4, 4])
- 4 is here 4 times
- 6 is here 2 times
- 2 is here 2 times
6 have the same frequency as 2
therefore should be [4, 4, 4, 4, 6, 2, 2, 6] not [4, 4, 4, 4, 6, 6, 2, 2].
Because in [4, 4, 4, 4, 6, 6, 2, 2] changing the order from the first appearance.
Created at: 2019/03/03 19:55; Updated at: 2019/03/04 07:47
The question is resolved.