Problem 1857 · Hard

Largest Color Value in a Directed Graph

Find the greatest count of one color on a directed path, or -1 if a cycle exists.

Open the interactive visualisation