Leetcode 1457. Pseudo-Palindromic Paths in a Binary Tree

Опубликовано: 23 Октябрь 2024
на канале: Lit Code
10
0

Leetcode 1457. Pseudo-Palindromic Paths in a Binary Tree - Python Solution

Problem Statement: [https://leetcode.com/problems/pseudo-...]
Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome.

Return the number of pseudo-palindromic paths going from the root node to leaf nodes.