Company: Google_24oct
Difficulty: medium
One count Problem Description You are given a string S consisting of only characters '0' and '1'. You have to answer Q queries. For each query, you are given an integer x. Task: Determine the total count of '1' in all substrings of length x in string S. Note: A substring of a string is a sequence obtained by removing zero or more elements from either the front or back or front and back of the string. The substrings of string '101' are: ['1'], ['0'], ['1'], ['10'], ['01'], ['101']. Function description Complete the solve function provided in the editor. This function takes the following 3 parameters and returns an integer array denoting the answer to the queries. S: Represents the given string Q: Represents an integer denoting the number of queries Queries: Represents the query array consisting of the elements x Input Format Note: This is the input format that you must use to provide custom input (available above the Compile and Test button) The first line contains a string S denoting t