We are given a matrix $M \in \{0,1\}^{n\times n}$ satisfying the following property.
The rows and columns of $M$ can be partitioned into $k$ rowgroups and $k$ colgroups respectively, such that in each block $B \subseteq M$ induced by these partitions, whenever an entry $B_{i,j}$ is equal to $0$, all the entries of the $i$-th row or the $j$-th column of $B$ are equal to $0$ too.
Namely, given any such block $B\in \{0,1\}^{r_B\times c_B}$ of $M$, $B_{i,j}=0$ implies (i) $B_{i,p}=0~~\forall p\in [c_B]$ or (ii) $B_{q,j}=0~~\forall q\in [r_B]$ ( or both (i) and (ii) ).
Question: What is the maximum rank of $M$?
I only know the maximum rank of $M$ is upper bounded by $k^2$.