Mark the nodes that are endpoints of a longest path in a tree.
Unlock detailed company stats for this questionUpgrade
Problem named 'Key Salesforce Teams'. Given a tree with n nodes representing an organizational hierarchy, return a binary array where a node is 1 if it is an endpoint of any longest path (tree diameter), otherwise 0.
Format · Salesforce AMTS OA.
Community answers
No answers contributed by the community yet.
Related questions
Given a tree, flag every node that is an endpoint of some longest path (diameter) in the tree.Find the longest path in a binary tree where every node has the same value.Find the maximum sum among the longest paths in a binary tree.Related courses

Course

Course
Course
