var maxDepth = function (root) {
if(root===null){
return 0;
}
return Math.max(dfs(root.left, 1), dfs(root.right, 1));
};
function dfs(root, count) {
if (root === null) {
return count;
}
return Math.max(dfs(root.left, count + 1),dfs(root.right, count + 1));
}