LeetCode-Solutions
LeetCode-Solutions copied to clipboard
Sum of distances in Tree
Pull Request Template
Description
Problem: Find sum of distances of a node from all other nodes. Link: Sum of distances in Tree Approach: By applying Re-rooting technique, standard to tree DP
Good question to understand basics of Tree DP for new-comers. Included link to a helpful youtube playlist in the readme.
Put check marks:
Have you made changes in README file ?
- [X] Added problem & solution under correct topic.
- [X] Specified Space & Time complexity.
- [X] Specified difficulty level, tag & Note(if any).
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
- [X] Test A: Passes all test cases on Leetcode
- [X] Test B: Checked on some custom corner test cases
Make sure all below guidelines are followed else PR will get Reject:
- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have commented my code so that it is easy to understand
- [X] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [X] Any dependent changes have been merged and published in downstream modules
I have resolved the conflicts. Please check.
Thank you