Given an $m\times n$ matrix $M_{ij}$ where $M_{ij}\in\{0,1\}$, find the minimal range $[a,b]$ for $1 \leq a \leq b \leq m$ such that each column has at least one value set to $1$ within that window, i.e. $\sum_{i=a}^bM_{ij} \geq 1$ for each $j \in \{1\dots n\}$.
I have come across this real-world problem that I have been struggling to find an efficient solution for. Is there an efficient solution for this problem or, if not, are there techniques to find a good approximation? I would be very grateful for any advice.