Search
⌘K

Leetcode 1457. Pseudo-Palindromic Paths in a Binary Tree

Count root-to-leaf paths in a binary tree of digits (1–9) that can be permuted into a palindrome — equivalently, paths whose digit counts have at most one odd frequency. With up to 1e5 nodes, this is solved by DFS while tracking parity of counts (e.g., a 9-bit mask) along each path.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.