给定一个二叉树,找出其最小深度。
    最小深度是从根节点到最近叶子节点的最短路径上的节点数量。
    说明:叶子节点是指没有子节点的节点。
    leedcode 111 二叉树最小深度 - 图1
    输入:root = [3,9,20,null,null,15,7]
    输出:2

    1. var minDepth = function(root) {
    2. if(!root) return 0;
    3. const q = [[root, 1]];
    4. while(q.length){
    5. const [n, l] = q.shift()
    6. if(!n.left&&!n.right) return l
    7. if(n.left) q.push([n.left, l+1])
    8. if(n.right) q.push([n.right, l+1])
    9. }
    10. };