Company: Sprinklr
Difficulty: medium
Odd Count Given an undirected graph with N nodes and N-1 edges, it doesn\'t contain any cycle or self-loop. The graph is connected. None of the nodes have any value associated with them initially. At an edge between any two nodes u and v, you can assign a value that is either 1 or 2. The sum of a path between any two vertices u and v is defined as the sum of assigned values of all the edges that comprise the path between nodes u and v. You have to process Q queries, each containing two integers a and b. For each query, you need to count the number of ways in which the sum of the path between nodes a and b can be made odd by assigning the values. Output the answer modulo 10 9 +7. Function Description Complete the solve function. This function takes the following 4 parameters and returns an array containing answers for Q queries: N : Represents the value of a number Edges : Represents a 2D array of integers representing the edges of the graph Q : Represents the size of the query array Qu