Check if any P continuous columns were left unpainted
for i in range ( N ) : NEW_LINE INDENT if ( vis [ i ] == False ) : NEW_LINE INDENT continuousCol += 1 NEW_LINE DEDENT else : NEW_LINE INDENT maxContinuousCol = max ( maxContinuousCol , continuousCol ) NEW_LINE continuousCol = 0 NEW_LINE DEDENT DEDENT maxContinuousCol = max ( maxContinuousCol , continuousCol ) NEW_LINE