You are given a binary string s and an integer k. You are also given a queries, where each queries[i] = [l_i, r_i].
A binary string satisfies the
The number of occurrences of k.
The number of occurrences of k.
Return an integer array ans of length queries.length, where ans[i] represents the total number of substrings of s within the range from index l_i to index r_i that satisfy the
Constraints:
s.length
s[i] is either
k s.length
queries.length
queries[i] == [l_i, r_i]
l_i r_i s.length
All queries are distinct.
You are given a binary string s and an integer k. You are also given a queries, where each queries[i] = [l_i, r_i].
A binary string satisfies the
The number of occurrences of k.
The number of occurrences of k.
Return an integer array ans of length queries.length, where ans[i] represents the total number of substrings of s within the range from index l_i to index r_i that satisfy the
Constraints:
s.length
s[i] is either
k s.length
queries.length
queries[i] == [l_i, r_i]
l_i r_i s.length
All queries are distinct.