We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
** The idea is to calculate for each node atleast n-k conncted subtrees
** Approach :
for each branch calculate connected nodes as we move up the branch. accumulate nodes at each level so far computed.
For first branch connected nodes as move up will be calculates subtrees
Second branch onwards , repeat step 1 and caculate subtrees possible as mentioned above using combinations at each level of already visited or computed tree.
4.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cut Tree
You are viewing a single comment's thread. Return to all comments →
Whats wrong in this understadning of solution. https://github.com/PrakashJetty/Solutions/blob/main/Sol10.java
** The idea is to calculate for each node atleast n-k conncted subtrees ** Approach :