Find the Second Minimum in a Tournament Tree

Given the root of a full binary tournament tree. Each leaf represents a competing value, and each non-leaf node stores the smaller value of its two children:

node.val = min(node.left.val,...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: