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.
My code is producing correct result but failing to achieve time complexity. I think I am unable to build optimal logic while calculating sum(v1.v2.d(v1,v2)).
Could any one help me to build logic for sum(v1.v2.d(v1,v2)). Please hlep me I am stuck.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Kitty's Calculations on a Tree
You are viewing a single comment's thread. Return to all comments →
My code is producing correct result but failing to achieve time complexity. I think I am unable to build optimal logic while calculating sum(v1.v2.d(v1,v2)).
Could any one help me to build logic for sum(v1.v2.d(v1,v2)). Please hlep me I am stuck.