Available question text
Determine whether any connected region of identical letters in the m x n grid contains a cycle of length ≥4 formed by adjacent (up/down/left/right) moves. Treat the grid as an undirected graph and detect a back-edge (ignoring the immediate parent to avoid trivial two-node backtracks) using DFS/BFS in O(mn) time.
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 1559. Detect Cycles in 2D Grid
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source