class Solution:
def movesToStamp(self, s: str, t: str) -> List[int]:
n = len(s)
m = len(t)
t = list(t)
s = list(s)
res = []
def check(i):
changed = False
for j in range(n):
if t[i + j] == "*": continue
if t[i + j] != s[j]: return False
changed = True
if changed:
t[i:i + n] = ["*"] * n
res.append(i)
return changed
changed = True
while changed:
changed = False
for i in range(m - n + 1):
changed |= check(i)
return res[::-1] if t == ['*'] * m else []