Given a square matrix of integers m, your task is to rearrange
its numbers in the following way:
First, sort its values in ascending order of how frequently the
number occurs in m. In the case of a tie, sort the equally frequent
numbers by their values, in ascending order.
Second, place the sorted numbers diagonally, starting from the
bottom right corner, like this:
Example
For
m = [[ 1, 4, -2],
[-2, 3, 4],
[ 3, 1, 3]]
the...