Maximum Path Sum

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • hard
  • Pro

Each node of a binary tree holds an integer, possibly negative. Find the largest sum of values along any path, where a path follows edges, visits each node at most once and need not pass through the root. Explain your recursion.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →