Pseudo-Palindromic Paths

Given a binary tree where each node has a digit from 1 to 9, count the number of root-to-leaf paths where the digits can be rearranged into a palindrome. A path is pseudo-palindromic if at most one digit appears an odd number of times along the path.

Examples
Input: [2,3,1,3,1,null,1]
Output: 2
Hints

Pseudo-Palindromic Paths

Given a binary tree where each node has a digit from 1 to 9, count the number of root-to-leaf paths where the digits can be rearranged into a palindrome. A path is pseudo-palindromic if at most one digit appears an odd number of times along the path.