Uber - SWE interview

For an undirected tree with English letter values -

Traverse the graph and find how many distinct palindromes can be formed

by rearranging the characters on the path from root to the query node.

Return an array with the number of distinct palindromes for each query.