Meesho SDE-1 OA (2023) | Tree Traversal, DFS, and Path Based Node Evaluation Problem
Meesho · Question · Posted Jun 2026
Q1. Count Good Nodes in Binary Tree Problem Statement Given the root of a binary tree, a node X is considered a good node if there are no nodes with a value greater than X on the path from the root to that node. Return the total number of good nodes in the binary tree. Example 1 Input root = [3,1,4,3,null,1,5] Output 4 Explanation Good nodes are: 3 (root) 3 (left child of 1) 4 5 Total good nodes = ...
The full answer & interview discussion are available to premium members.
Log in Create a free account