You are given an unweighted undirected tree with n nodes labeled from n edges of length n edges[i]
You are also given three pairwise distinct nodes x, y, and z.
For any node u in the tree, let u to nodes x, y, and z sorted in nondecreasing order such that u is called special if these distances satisfy the Pythagorean condition:
Return the number of special nodes in the tree.
Constraints:
x, y, and z are pairwise distinct.
The input is generated such that edges represents a valid tree.
You are given an unweighted undirected tree with n nodes labeled from n edges of length n edges[i]
You are also given three pairwise distinct nodes x, y, and z.
For any node u in the tree, let u to nodes x, y, and z sorted in nondecreasing order such that u is called special if these distances satisfy the Pythagorean condition:
Return the number of special nodes in the tree.
Constraints:
x, y, and z are pairwise distinct.
The input is generated such that edges represents a valid tree.