Available question text
Find all start indices i where substring a occurs in s and there exists a start j where substring b occurs with |j − i| ≤ k. With s up to 5e5, this requires finding all occurrences of a and b (e.g., linear scan/KMP) and then checking proximity efficiently (two-pointer, binary search, or prefix array).
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 3008. Find Beautiful Indices in the Given Array II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source