Company: Somehting
Difficulty: medium
Problem Description There is a tree with tree_nodes nodes numbered from 0 to tree_nodes - 1. The distance between two nodes is the number of edges in the unique path between them. A node is considered "special" if its distances to three specific nodes x, y, and z, when sorted in ascending order, form a Pythagorean triple (a, b, c) where a^2 + b^2 = c^2. Complete the function countPythagoreanTriples in the editor. It must return the total number of special nodes in the tree. Function Description Complete the function countPythagoreanTriples in the editor with the following parameters: - int tree_nodes: the number of nodes - int tree_from[n]: one end of edge i - int tree_to[n]: the other end of edge i - int x: the node associated with value a in the Pythagorean triple - int y: the node for value b - int z: the node for value c Returns int: the total number of special nodes Examples Example 1 Input tree_nodes = 9, tree_edges = 8 tree_from = [0, 0, 2, 2], tree_to = [1, 2, 3, 4] ... (additi