MakeMyTrip Associate Developer Interview Question 2021 September | Trees | on-campus
makemytrip · Question · Posted Jun 2026
Question 1: Count Good Nodes in Binary Tree Problem Statement 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's value. Return the number of good nodes in the binary tree. Constraints The number of nodes in the binary tree is in the range [1, 105] Each node's value is between [-104, 104] Examples Example 1: Input: root ...
The full answer & interview discussion are available to premium members.
Log in Create a free account