Function to count the number of nodes with blue color
def countBlue ( color , n ) : NEW_LINE INDENT blue = 0 ; NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( color [ i ] == 2 ) : NEW_LINE INDENT blue += 1 NEW_LINE DEDENT DEDENT return blue ; NEW_LINE DEDENT