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...
Statement
You are given a rooted tree with parent of size parent[i] is the parent of node
Ask