Skip to content

Code challenge

Maximum Depth of Binary Tree

Problem

Given the root of a binary tree (`{ val, left, right }`), return its maximum depth (number of nodes along the longest root-to-leaf path).
Editor · javascript4 lines · 48 chars
Back to topic
Maximum Depth of Binary Tree — Trees (BST, AVL) · Aevrofy