> For the complete documentation index, see [llms.txt](https://leetcode.realtemirov.uz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://leetcode.realtemirov.uz/problems/2236.-root-equals-sum-of-children.md).

# 2236. Root Equals Sum of Children

🟩 Easy

## Solution

My Solution

```go
/**
 * Definition for a binary tree node.
 * type TreeNode struct {
 *     Val int
 *     Left *TreeNode
 *     Right *TreeNode
 * }
 */
func checkTree(root *TreeNode) bool {
    return root.Val == (root.Left.Val + root.Right.Val)
}
```

![result](https://600345290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSK2xH3txU3tYyDsT8mQ%2Fuploads%2Fgit-blob-c4411ee5f6d6318bdb961c6a9b0f52440b3e8c5e%2F2236.png?alt=media)

Leetcode: [link](https://leetcode.com/problems/root-equals-sum-of-children/description/)
