题:https://leetcode.com/problems/longest-univalue-path/description/ 题目 Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may no
题目: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example: Given binary tree, 5/ \1 5/
参考:点击打开链接 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode(int x) { val = x; }* }*/public class Solution {priva