You are given a string s of length n, an integer array order of length n which is a permutation of integers from k.
At each second t starting from order[t] in s is replaced with the character '*'.
A substring of s is considered valid if it contains at least one '*'.
The string s becomes active when the total number of valid substrings is greater than or equal to k.
Return the minimum time t at which s becomes active. If it is impossible for s to become active after all replacements, return
Constraints:
s.length
order.length
order[i]
s consists of lowercase English letters.
order is a permutation of integers from
You are given a string s of length n, an integer array order of length n which is a permutation of integers from k.
At each second t starting from order[t] in s is replaced with the character '*'.
A substring of s is considered valid if it contains at least one '*'.
The string s becomes active when the total number of valid substrings is greater than or equal to k.
Return the minimum time t at which s becomes active. If it is impossible for s to become active after all replacements, return
Constraints:
s.length
order.length
order[i]
s consists of lowercase English letters.
order is a permutation of integers from