If the current cell is not blocked and the light can travel from the next row and the next column then the current cell is valid
if ( row [ i ] [ j ] and col [ i ] [ j ] ) : NEW_LINE INDENT cnt += 1 NEW_LINE DEDENT