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 approach guarantees an optimal solution for this problem?
