Topological Sort - Longest Path With Different Adjacent Characters
You are given a directed acyclic graph where each node has a character label. You want to find the longest path such that no two adjacent nodes on the path share the same character. Which algorithmic pattern best fits solving this problem efficiently?
