Light Mode
Dark Mode
"Sort Array by Element Frequency" is broken

When i run my solution asserting goes right. But "Check" fails.

Your result:[4,4,4,4,6,6,2,2,2]
Right result:[4,4,4,4,2,2,2,6,6]
Fail:frequency_sort([4,6,2,2,2,6,4,4,4])

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.

So the "Right result" is wrong.

Created: Feb. 26, 2019, 7:45 a.m.
Updated: Dec. 15, 2021, 11:20 a.m.
3
14
User avatar
Marlen_Nurmakov