Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📃: Add solution to Kth largest sum in a binary tree problem on leetcode #125

Closed
simran0963 opened this issue Oct 23, 2024 · 2 comments
Closed

Comments

@simran0963
Copy link

🟢 Title : Kth largest sum in binary tree
🟢 Programming language : c++
🟢 Objective : To return the sum of the level which is kth largest, if it exists.
🟢 Summary : This problem asks you to return the largest sum on the kth number in a binary tree. If it does not exists, return -1 else return the sum.
In this approach I have used breadth first search technique to find the level wise sum. once the sum of a level is calculated, I have stored it in a vector. and upon sorting the vector we can get the kth largest value, if it ec=xists at all. if not then it returns -1.

Please merge it under the tags of hacktoberfest2024 and hactoberfest-accepted.


✅ Details to Include When Taking the Issue:
Name : Simran


Happy Contributing! 🚀

Wishing you all the best on your open source journey😍.
Enjoy! 😎

Copy link

👋 Thanks for opening this issue! First please star the repository and follow me in github. We appreciate your feedback and will look into it as soon as possible.

Copy link

Hello @simran0963! Your issue #125 has been successfully closed. ✅ Thank you for your contribution and helping us improve the project! If you have any more ideas or run into other issues, feel free to open a new one. Happy coding! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants