Isn't this problem the same as computing the height of the tree?
What's the point?
The height of a node is "the number of edges from the node to the deepest leaf". The MinDepth of the tree is the exact opposite. It is the number of edges to the most shallow leaf in the tree, among all the leaves in the tree.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.