If i say it clearly you just need to check whether the frequency of ones count i all the rows must be at max two and same for all the columns
if the frequency is two , you should make sure one the frequency is 0.
If i say it clearly you just need to check whether the frequency of ones count i all the rows must be at max two and same for all the columns
if the frequency is two , you should make sure one the frequency is 0.