LC: 250. Count Univalue Subtrees
https://leetcode.com/problems/count-univalue-subtrees/
Input: root = [5,1,5,5,5,null,5]
Output: 4Input: root = []
Output: 0Input: root = [5,5,5,5,5,null,5]
Output: 6Last updated
https://leetcode.com/problems/count-univalue-subtrees/
Input: root = [5,1,5,5,5,null,5]
Output: 4Input: root = []
Output: 0Input: root = [5,5,5,5,5,null,5]
Output: 6Last updated
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public int countUnivalSubtrees(TreeNode root) {
}
}