AlgoMaster Logo

Longest Path With Different Adjacent Characters

parent=[-1,0,0,1,1,2],s=abacbe
0 / 39
algomaster.io
Step:Find the longest path in this tree where no two adjacent nodes share a character