Longest Path With Different Adjacent Characters
Each node keeps its two longest downward chains that avoid equal neighbors, and a path through the node joins them.
Each node keeps its two longest downward chains that avoid equal neighbors, and a path through the node joins them.