Hi, I came across a problem in hackerrank test, the problem statement was:
Given an undirected graph with N nodes and M edges, each edge contains a gadget with id i (where 1 <= i <= G), after that you're given Q queries, in each query you've two nodes u and v, you've to find number of distinct gadgets in all simple paths from u to v. Constraints: 1 <= N, Q, M <= 10^5 1 <= G <= 40 Time Limit: 1 sec
I was unable to solve it and couldn't find a solution on internet as well, can anyone tell how to solve it or whether it's not possible solve it