Given a tree with a character on each node, count the paths from each query node toward the root whose characters can be rearranged into a palindrome.
Unlock detailed company stats for this questionUpgrade
Given an undirected tree rooted at 0, where each node has a char value, and an array of queries. If the path from queries[i] to the root 0 contains the nodes queries[i], v1, v2, ..., vn, 0, count how many paths from queries[i] to vi exist such that the characters in the path can be rearranged to form a palindrome.
Community answers
No answers contributed by the community yet.
Related questions
Check whether characters on a graph path between two nodes can form a palindrome.Given a list of strings, count the pairs (i, j) whose concatenation can be permuted into a palindrome.Given a string s, return true if the s can be a palindrome after deleting at most one character from it.Related courses

Course

Course
Course
