← Paytm questions
CodingReported in a candidate post, Nov 2020

Sum of nodes at distance k from leaf nodes

Filed under Paytm

Given a binary tree and an integer k, find the sum of all nodes that are at a distance of exactly k from any leaf node in the tree.

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

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