Available question text
Count how many cells belong to at least one horizontal substring (left-to-right, wrapping from end of a row to the first column of the next row) and at least one vertical substring (top-to-bottom, wrapping from bottom of a column to the first row of the next column) that both equal the given pattern. The challenge is to efficiently find and intersect all matching horizontal and vertical occurrences in an m×n grid (m·n ≤ 1e5) under the specified wrap rules.
Related questions
Continue with questions that share topics or the same question type.
- Count Beautiful Substrings I
Coding
- Count Beautiful Substrings II
Coding
- Count Binary Substrings
Coding · String · Two Pointers
- Count Complete Substrings
Coding
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 3529. Count Cells in Overlapping Horizontal and Vertical Substrings
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source