โ† Walmart questions

Sum at horizontal distance

Filed under Walmart

Given a binary tree, compute the sum of all node values at each horizontal distance from the root. Return the sums ordered by their horizontal distance in descending order.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Walmart questions

Collected from public candidate posts and coding forums. Updated Nov 2026.