Given a tree represented by parent array and a string s where s[i] is the character assigned to node i, return the length of the longest path where adjacent nodes have different characters.
30:00
Java
Longest Path With Different Adjacent Characters
hard
Topics
Companies
Given a tree represented by parent array and a string s where s[i] is the character assigned to node i, return the length of the longest path where adjacent nodes have different characters.