You are given an integer n representing the number of nodes in an undirected graph, with nodes labeled from n edges, where edges[i] a_i, b_i a_i and node b_i.
Return the total number of pairs of distinct nodes such that there is no path between them.
Constraints:
n
edges.length
edges[i].length
a_i, b_i n
a_i b_i
There are no repeated edges.
You are given an integer n representing the number of nodes in an undirected graph, with nodes labeled from n edges, where edges[i] a_i, b_i a_i and node b_i.
Return the total number of pairs of distinct nodes such that there is no path between them.
Constraints:
n
edges.length
edges[i].length
a_i, b_i n
a_i b_i
There are no repeated edges.