Codeforces
CF Step
Youtube Linkedin Discord Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

ToDo : Three Paths on a Tree

  • Solve CSES : Tree Distances 1
  • Think about DP approach.
  • Think about ways to find diameter with only DFS.
  • Think about ways to solve this with 4 DFS (and no BFS or multi source BFS) as mentioned in this comment
  • Prove why diameter is optimal.