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.
Switching the parent-child relationship is actually a pretty standard thing to do in programming contests. Although this does not necessarily test your ability to write an algorithm that solves the given problem, it does make you pay attention to your assumptions.
Generally speaking, being conscious of your assumptions is part of being a good programmer.
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 →
Switching the parent-child relationship is actually a pretty standard thing to do in programming contests. Although this does not necessarily test your ability to write an algorithm that solves the given problem, it does make you pay attention to your assumptions.
Generally speaking, being conscious of your assumptions is part of being a good programmer.