Day-27 GFG (Diagonal sum in binary tree)
Channel: Dawn Of Coders
Date: 2024-03-22

🌟 Welcome to GeekForGeeks Day on our tutorial channel! 🌟 In this video, we dive into solving a challenging problem: "Diagonal sum in binary tree." Join us as we explore the intricacies of this problem and provide a clear solution.

🔗 Connect with us:
Twitter: DawnOfCoders
Instagram: dawnofcoders
GitHub Repo: AggarwalNeelesh/GeekForGeeks-POTD

Problem Statement:
Consider Red lines of slope -1 passing between nodes in a binary tree. The diagonal sum in a binary tree is the sum of all node data lying between these lines. Given a Binary Tree of size n, print all diagonal sums.

For the following input tree, output should be 9, 19, 42:

9 is the sum of 1, 3, and 5.
19 is the sum of 2, 6, 4, and 7.
42 is the sum of 9, 10, 11, and 12.
🚀 Don't forget to check out our tutorial and dive into the world of problem-solving!