You are given an m×n binary matrix of 1’s (representing soldiers) and 0’s (representing civilians). The soldiers are positioned in front of the civilians, i.e., all the 1’s will appear to the left of all the 0’s in each row.
A row i is weaker than a row j if any of the following is TRUE: