EDITORIAL OF THE QUESTION(RECTANGLE)

https://www.codechef.com/CCRC21C/problems/ISREC

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.

Link to the official editorial: Editorial

1 Like