...
/Solution: Longest Path With Different Adjacent Characters
Solution: Longest Path With Different Adjacent Characters
Let’s solve the Longest Path With Different Adjacent Characters problem using the Topological Sort pattern.
We'll cover the following...
We'll cover the following...
Statement
You are given a rooted tree with parent of size parent[i] is the parent of node parent[0]
Additionally, you are provided a string s of length s[i] represents the character assigned to node