solulubeta
Sign in
NeetCode 150 / Trees
07.03 · Problem

Diameter of Binary Tree

Easy DFS returns height, updates a global best 1 video LC 543 Pro

This problem is part of solulu Pro

The diameter of a binary tree is the number of edges on the longest path between any two nodes. The path doesn't have to pass through the root. Return the diameter.

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 48 of 150 · updated 2026-10-12