{"size": 374, "ext": "js", "max_stars_repo_path": "leetcode/maximum_depth_of_binary_tree.js", "max_stars_repo_name": "SVMarshall/programming-challanges", "max_stars_repo_stars_event_min_datetime": "2015-12-18T23:42:38.000Z", "max_stars_repo_stars_event_max_datetime": "2015-12-18T23:42:38.000Z", "max_issues_repo_path": "leetcode/maximum_depth_of_binary_tree.js", "max_issues_repo_name": "SVMarshall/programming-challanges", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "leetcode/maximum_depth_of_binary_tree.js", "max_forks_repo_name": "SVMarshall/programming-challanges", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.0, "max_line_length": 87, "alphanum_fraction": 0.614973262}
// https://leetcode.com/problems/maximum-depth-of-binary-tree/

/**
 * Definition for binary tree
 * function TreeNode(val) {
 *     this.val = val;
 *     this.left = this.right = null;
 * }
 */

/**
 * @param {TreeNode} root
 * @returns {number}
 */
var maxDepth = function(root) {
    return root === null ? 0 : 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
};