Minimum Depth of Binary Tree
Easy · Trees · about 10 minutes
Asked at Meta, Amazon, Google, Microsoft, Bloomberg.
Return the minimum depth of a binary tree: the number of nodes on the shortest path from the root down to the nearest leaf (a node with no children). An empty tree has depth 0.