Leetcode 250. Count Univalue Subtrees
Given a binary tree, count how many subtrees are "univalue" (every node in the subtree has the same value). The core challenge is to determine for each node, via a bottom-up (postorder) traversal, whether its subtree is uniform without re-checking nodes, yielding an O(n) solution.
Asked at:
Grab
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early September, 2026
Grab
Senior
https://leetcode.com/problems/count-univalue-subtrees/description/
Hello Interview Premium
Your account is free and you can post anonymously if you choose.