Problem 36. Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix.
For example, given
the answer would be the row vector
since each of these appears three or more times in the rows of matrix A. Elements should be returned sorted ascending.
Note there is no guarantee that there are any such elements; if there are none, the routine should return the empty set. Also, the matrix might contain repeats, very large or very small numbers, or NaNs (though NaN should not be treated as a number to be returned in the output).
Solution CommentsShow comments
Problem Recent Solvers1919