Given the root of a binary tree where each node stores a digit from 1 to 9, a root-to-leaf path is called pseudo-palindromic if you can rearrange the digits on that path to form a palindrome.
A sequence can be rearranged into a palindrome when at most one digit appears an odd number of times.
Return the number of pseudo-palindromic root-to-leaf paths.
Input / output
root: TreeNode (JSON test fixture is a LeetCode-style level-order array, e.g. [2,3,1,3,1,null,1], with null for a missing child)intHow would you adapt the solution if values were not limited to digits 1 through 9, so a fixed 9-bit mask was no longer enough?