Count Good Nodes Problem

Count Good Nodes Problem — ExecCode Medium DSA Practice

Solve the Count Good Nodes problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Practice companion for CodeFlow count-good-nodes.

Examples

Input {"root": [8, 4, 12, 2, 6, 10, 14, 1, 3]}; Output 3. Input {"root": [3, 1, 4, 3, null, 1, 5]}; Output 4. Input {"root": [3, 3, null, 4, 2]}; Output 3

Constraints

1 ≤ n ≤ 10^5

Practice Count Good Nodes free on ExecCode. Browse DSA problems, topic map, and placement guides.