Update cntMaxRows
if ( ! mp . ContainsKey ( mat [ i ] ) ) { cntMaxRows = Math . Max ( cntMaxRows , mp [ onesCompRow ] + 1 ) ; } else if ( ! mp . ContainsKey ( onesCompRow ) ) { cntMaxRows = Math . Max ( cntMaxRows , mp [ mat [ i ] ] + 1 ) ; } else { cntMaxRows = Math . Max ( cntMaxRows , mp [ mat [ i ] ] + mp [ onesCompRow ] + 1 ) ; } } return cntMaxRows ; }