Company: Service now_26oct
Difficulty: medium
Count Minimum Characters Problem Description A string s of length n consists solely of digits from 0-9. Characters in s are accessible sequentially, meaning the first '1' chosen is the leftmost '1' in s . There is an array arr containing m strings, each also composed of digits from 0-9. Determine the minimum number of characters required from the beginning of s to form a permutation of each string in arr . Return an array of integers where the i th element represents the minimum length of a prefix of s that contains a permutation of the i th string in arr . If a string cannot be formed, return -1 for that index. Function Signature: vector<int> countMinimumCharacters(string s, vector<string> arr) The function accepts the following parameters: string s : The special string of length n . vector<string> arr : An array of strings to construct. The function is expected to return vector<int> , where the i th element corresponds to the minimum number of characters requi