Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2791. Count Paths That Can Form a Palindrome in a Tree
Count pairs of nodes in a rooted tree whose path edge-letters can be rearranged into a palindrome — equivalently, the multiset of letters on the path has at most one character with odd count. This reduces to comparing parity bitmasks of root-to-node letter counts: pairs with equal masks or masks differing by one bit form valid paths.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.