# Univalued Binary Tree (Leetcode 965)

Problem Link: <https://leetcode.com/problems/univalued-binary-tree/>

```python
class Solution:

    def isUnivalTree(self, root: Optional[TreeNode]) -> bool:
        
        def fun(root, value):
        
            if(root is None):
                return True
            l=fun(root.left,value)
            r=fun(root.right,value)
            if(l and r and root.val==value):
                return True
            return False
            
        return fun(root, root.val)
```
