Path is allowed if size of present node becomes 0 i . e it has no child root and no more than m consecutive 1 's
if ( len ( adj [ node ] ) == 1 and node != 1 ) : NEW_LINE INDENT ans += 1 NEW_LINE DEDENT for x in adj [ node ] : NEW_LINE INDENT if ( not visited [ x ] ) : NEW_LINE INDENT dfs ( x , count , m , arr , k ) ; NEW_LINE DEDENT DEDENT