---
title: "Discussion on \"Count Good Nodes in Binary Tree\" | Hashnode"
description: "Discussion on \"Count Good Nodes in Binary Tree\". Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.\nReturn the number of good nodes in the binary tree.\nExample 1:\n\nInput: root = [3,1,4,3,null,1,5]\nOutput: 4\nExpl..."
url: "https://hashnode.com/posts/count-good-nodes-in-binary-tree/66789270ac5ce45425b4c8b6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Count Good Nodes in Binary Tree](https://lietcode.hashnode.dev/count-good-nodes-in-binary-tree?utm_source=hashnode&utm_medium=feed)

Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. Return the number of good nodes in the binary tree. Example 1: Input: root = \[3,1,4,3,null,1,5\] Output: 4 Expl...

Jun 23, 2024 · 3 min read · lietcode.hashnode.dev  
Read the article

-   [#tree](https://hashnode.com/tag/tree)
-   [#trees](https://hashnode.com/tag/trees)

## Written by

[Abhi](https://hashnode.com/@lietcode)

@lietcode

  
[View profile](https://hashnode.com/@lietcode)

Let's crack the interviews

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
