Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identical size.
Examples:
Inputs A = [1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 ]
and B = [0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 ]
Output tf is false
Inputs A = [1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 ] and B = [0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0]
Output tf is true
I guess zeros are not included as common elements.
Yes. Seems to be a somewhat "ill-posed" problem...
What does "they share a common row, column entry" mean?
Re-wording is needed for this problem. Here is how I interpreted the problem:
1. "common row, column entry" means a same value at the same row-column location
2. zeros don't count. You need to check for non-zeros...
Find common elements in matrix rows
808 Solvers
Find a subset that divides the vector into equal halves
289 Solvers
345 Solvers
convert matrix to single column
217 Solvers
402 Solvers