Available question text
Given a binary string s and many queries [first, second], for each query find the shortest substring whose integer value val satisfies val ^ first == second (returning its [left,right] or [-1,-1]). Key insight: since values ≤ 1e9, relevant substring lengths are bounded (≈30), so you can preprocess integer values of short substrings and answer queries by looking up target = first ^ second.
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 2564. Substring XOR Queries
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source