(root, min, max *TreeNode)
| 34 | } |
| 35 | |
| 36 | func dfs(root, min, max *TreeNode) bool { |
| 37 | if root == nil { |
| 38 | return true |
| 39 | } |
| 40 | |
| 41 | if min != nil && root.Val <= min.Val { |
| 42 | return false |
| 43 | } |
| 44 | |
| 45 | if max != nil && root.Val >= max.Val { |
| 46 | return false |
| 47 | } |
| 48 | |
| 49 | return dfs(root.Left, min, root) && dfs(root.Right, root, max) |
| 50 | } |
no outgoing calls
no test coverage detected