Tap here to switch tabs
Problem
Submissions

Problem: Pseudo-Palindromic Paths in a Binary Tree

Try to solve the Pseudo-Palindromic Paths in a Binary Tree problem.

Statement

Given the root of a binary tree, return the number of pseudo palindromic paths from the root node to any leaf node.

A path from the root to a leaf is considered pseudo palindromic if at least one permutation of the node values along the path forms a palindrome.

Constraints:

  • The number of nodes in the tree is in the range [1,105][1, 10^5].

  • 1≤1 \leq Node.val ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Pseudo-Palindromic Paths in a Binary Tree

Try to solve the Pseudo-Palindromic Paths in a Binary Tree problem.

Statement

Given the root of a binary tree, return the number of pseudo palindromic paths from the root node to any leaf node.

A path from the root to a leaf is considered pseudo palindromic if at least one permutation of the node values along the path forms a palindrome.

Constraints:

  • The number of nodes in the tree is in the range [1,105][1, 10^5].

  • 1≤1 \leq Node.val ≤9\leq 9