You are given two strings stamp and target. Initially, there is a string s of length target.length with all s[i] == '?'.
In one turn, you can place stamp over s and replace every letter in the s with the corresponding letter from stamp. For example, if stamp = "abc" and target = "abcba", then s is "?????" initially. In one turn you can:
- place
stampat index 0 ofsto obtain"abc??" - place
stampat index 1 ofsto obtain"?abc?" - place
stampat index 2 ofsto obtain"??abc"
Note that stamp must be fully contained in the boundaries of s in order to stamp (i.e., you cannot place stamp at index 3 of s).
We want to convert s to target using at most 10 * target.length turns. Return an array of the index of the left-most letter being stamped at each turn. If we cannot obtain target from s within 10 * target.length turns, return an empty array.
Input & Output
Constraints
- 1 ≤ stamp.length ≤ target.length ≤ 1000
- stamp and target consist of lowercase English letters