|
0
Use union-find sets to merge the sets of every "relevant" element, whose values should be the same. For every set you iterate all its members and get the maximum of their rows and columns. |
|
+13
Sort the whole array and then iterate it from smaller to larger. Maintain the maximum value of every row and column to decide what the next value will be. |
|
+3
I think there is another solution for DIV1C with union-find sets and greedy. |