I have a matrix in this case of 3x11, but I want this to work for any dimension matrix. I want per row a column position on a non-zero value in that row, but that this value should be different than a column position already selected for another row. I also tried to solve it with a set of three lists and tried to get a sample from each list.
For example:
m = {{1, 2, 1, 1, 1, 1, 0, -1, -2, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}}
A result would be {8,9,11} Even though position 8 is non-zero in the first and the second row/list, this position can be selected as long as a different position is chosen for the second row/list.
Preferentially the last positions (with the higher numbers) should be selected.