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
Given a string s, return true if the s can be a palindrome after deleting at most one character from it.Given a large n-ary tree where the root node can pass information to one child per iteration, and in subsequent iterations, nodes can pass information to one child while the root continues with oth...Related courses

Course

Course
Course
