Problem 1857 · Hard
Find the greatest count of one color on a directed path, or -1 if a cycle exists.
Open the interactive visualisation