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.
Suppose u have a tree of total value sum as 1000
Then u separated a node of value say 200
Then new trees will be of size 800 and 200
800-200=600 which can be written as 1000-2*(200)=60
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cut the Tree
You are viewing a single comment's thread. Return to all comments →
Suppose u have a tree of total value sum as 1000 Then u separated a node of value say 200 Then new trees will be of size 800 and 200 800-200=600 which can be written as 1000-2*(200)=60