Google logoGoogle
Coding·45 minMembers

Longest Consecutive Path in Binary Tree

Members only

Given a binary tree, return the length of the longest parent-to-child path whose values increase consecutively by 1. Follow-up: allow the path to extend in any direction through the tree, not only fro...

SWE
tree
dfs
recursion
medium
Frequency
Single report
Last asked
2026-07-02
Stage
phone-screen

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...