Explain short solution to find farthest point from every node please !

Revision en2, by youssefbou62, 2019-09-06 16:30:00

I was trying to solve this problem and this is my AC code. I then found This short solution written by some user. Can anyone explain what it does and why is it correct?

Tags tree, dpontree, dp, graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English youssefbou62 2019-09-06 16:30:00 21 Tiny change: 't it does ? ' -> 't it does and why is it correct? '
en1 English youssefbou62 2019-09-06 15:49:30 347 Initial revision (published)