You are given a binary string s and a two dimensional integer array queries where each queries[i] = [first_i, second_i].
For each query s starting at index left_i and ending at index right_i inclusive, such that the decimal value represented by this binary substring, denoted as val, satisfies:
val first_i second_i
where
If multiple valid substrings exist for a query, select the one with the shortest length. If there is still a tie, select the substring with the smallest starting index left_i. If no such substring exists, the answer for that query is
Return an array ans where ans[i] = [left_i, right_i] represents the answer to the
Constraints:
s.length
s[i] is either '0' or '1'
queries.length
first_i, second_i
You are given a binary string s and a two dimensional integer array queries where each queries[i] = [first_i, second_i].
For each query s starting at index left_i and ending at index right_i inclusive, such that the decimal value represented by this binary substring, denoted as val, satisfies:
val first_i second_i
where
If multiple valid substrings exist for a query, select the one with the shortest length. If there is still a tie, select the substring with the smallest starting index left_i. If no such substring exists, the answer for that query is
Return an array ans where ans[i] = [left_i, right_i] represents the answer to the
Constraints:
s.length
s[i] is either '0' or '1'
queries.length
first_i, second_i