I have an section of numbers (5x5) that has several repeating numbers. I have another section of the same size in which I'd like to store those same numbers, in order of frequency (most frequent first).
Source:
4 6 9 3 2
7 3 2 5 6
0 1 9 8 4
4 7 1 5 9
2 5 4 8 6
Target:
4 6 9 2 5
3 7 1 8 0
- - - - -
- - - - -
- - - - -
The numbers would be of an arbitrary range, not just 0-9. The order of same-frequency numbers can be by either value or order of appearance. The target section must be filled row by row, from left to right.
Anybody know how I might accomplish this?
Bookmarks