Search⌘ K
AI Features

Longest Path With Different Adjacent Characters

Longest Path With Different Adjacent Characters uses a parent array and node labels for a tree. Return its longest path whose neighboring characters differ.

Statement

You are given a rooted tree with ...