It sounds a bit like the Eight Queens Puzzle , where you need to place 8 queens on a chessboard without any of them in the way of the other. (If you do not know chess, do not worry by analogy).
Suppose your array of examples:
[6, 4.5, 6]
[7, 6, 5]
[9, 4.5, 6]
Find the largest value as a whole (in this case 9) and lock its column and row.
Your new array looks like this (with x how the selection is no longer valid).
[x, 4.5, 6]
[x, 6, 5]
[x, x, x]
Repeat this process over and over until you select one value from each column and each row.
Now, as a warning, the presence of several places for the current max (as in the second stage of the example, with two 6s) leads to several more conditions. I will stay with pleasure with you, but I will be happy to provide you with additional assistance if necessary.
Attention
, . ( :
[10, 9, 1]
[ 9, 9, 1]
[ 1, 1, 1]
, .