Light Mode
Dark Mode
Mistake in mission example

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: March 3, 2019, 7:55 p.m.
Updated: March 4, 2019, 7:47 a.m.
0
16
User avatar
fierce_mark