---
title: "Discussion on \"Count Good Nodes in Binary Tree - Kotlin (Medium)\" | Hashnode"
description: "Discussion on \"Count Good Nodes in Binary Tree - Kotlin (Medium)\". 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\n\nInput: root = [3,1,4,3,null,1,5]\nOutput: 4\nExp..."
url: "https://hashnode.com/posts/count-good-nodes-in-binary-tree-kotlin-medium/6210bf7830c8050670ed2a5a"
---

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

Discussion

# [Count Good Nodes in Binary Tree - Kotlin (Medium)](https://abhiculous.hashnode.dev/count-good-nodes-in-binary-tree-kotlin-medium?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 Exp...

Feb 19, 2022 · 1 min read · abhiculous.hashnode.dev  
Read the article

## Written by

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

@abhiculous

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

stay sleeppyy, stayy foolish

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
