Company: BNY_18nov
Difficulty: medium
Track Command Position Problem Description A network contains `n` nodes, where node 1 is the root node. The network structure is represented as a tree, with each node (except the root) having exactly one parent specified by the `par` array, where `par[i]` represents the parent of node `i` (1-based indexing). Commands propagate through the network as follows: - A network sends a command to its direct child nodes in ascending order of their indices. - Each child node propagates the command to its subtree using the same process. - The propagation stops when all nodes in the subtree have received the command. Given `q` queries, each query `[startNodeId, index]` asks for the `index`-th node in the sequence of command propagation starting from `startNodeId`. Return the `index`-th node or -1 if fewer than `index` nodes receive the command. Each query is processed independently. Complete the function `getAnswersToQueries` in the editor with the following parameters: - `int par[]`: Each `par[i]