← Samsung questions

Sum of elements at Kth level in a tree

Filed under Samsung

Given a binary or generic tree represented as a string format (e.g., parent-child representation or nested parentheses) and an integer K, calculate the sum of all node values at the Kth level from the…

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

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