Available question text
Given a directed graph where each node has a lowercase color, find the maximum number of occurrences of any single color along any valid path, or return -1 if the graph contains a cycle. The core challenge is cycle detection plus aggregating color frequencies across the DAG (typically solved with topological order or DFS + DP to propagate 26-color counts).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1857. Largest Color Value in a Directed Graph
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source