Company: Gameberry labs
Difficulty: medium
String Matching Query Write a function that takes a string and a vector of queries to find matching substrings. For each query in the vector, determine if there is a matching substring and return the results. Input Format A string s containing lowercase letters A vector of integers queries where each query contains two integers representing substring indices Output Format Return a vector of integers representing the results for each query. Function Signature vector<int> solve(string s, vector<int> queries) Examples Input: String s = \"abceabcf\" Queries = [8, 1, 3, 2, 5, 3, 3, 4, 4] Output: [3, 2, 1, 0] In the second test case, the substring [2,5] = \"bce\". Its prefix matches best with substring starting from index 6. Hence, the answer is 2. Code Template #include<bits/stdc++.h> using namespace std; vector<int> solve(string s, vector<int> queries) { // Write your code here } int main() { ios::sync_with_stdio(0); cin.tie(0); string s; // Rest of the main f