Longest Univalue Path
Medium
Tree DP & Advanced Trees
Print the length (in edges) of the longest path in which every node has the same value. The path may not pass through the root.
Constraints
0 <= number of nodes <= 10^4 -1000 <= value <= 1000
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.