Uber · SWE
Rounds
- Coding interview
Questions asked
- 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.
Tips
- Think about how to efficiently count palindromes using character frequencies. For each path, a palindrome can be formed if at most one character has an odd count.
