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.
Ok
HackerRank
|
Prepare
Certify
Compete
Hiring developers?
Log In
Sign Up
Prepare
Algorithms
Graph Theory
Crab Graphs
Discussions
Crab Graphs
Problem
Submissions
Leaderboard
Discussions
Editorial
You are viewing a single comment's thread.
Return to all comments →
csimpilimpihova1
2 years ago
+ 2 comments
Find terminal nodes (leaf nodes are they called?) - They will be the nodes that have only one adjascent node.
Find the direct parents of these nodes
Out of point
2
find those direct parents which have more than T leaf nodes
Substract from n (total number of vertices) the count of all standalone nodes, plus the sum of the excess leaf nodes from point
3
.
Ready.
Crab Graphs
You are viewing a single comment's thread. Return to all comments →
Ready.