← Salesforce questions
CodingReported in a candidate post, Jul 2024

Sum of nodes with even-valued grandparent

Filed under Salesforce

Given the root of a binary tree, return the sum of the values of all nodes whose grandparent has an even value. If no such node exists, return 0.

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 Salesforce questions

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