Python Solution 2 pointers + dp
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    \'\'\'\n    vbcca\n    abc\n    012 \n    first iterate through whole arr and find k=1 and len[ans]==word2.len\n    then iterate from i+1 to n and chek min arr\n    \'\'\'\n    def validSequence(self, word1: str, word2: str) -> List[int]:\n        n=len(word1)\n        m=len(word2)\n        j=m-1\n        dp = [0 for i in range(n+1)] # from i=n-1 to current i how many characters of the word2 can we take from back in specific sequence\n        q=n-1\n        for i in range(n-1,-1,-1):\n            if(i!=n-1):\n                dp[i]=dp[i+1]\n            if(j>=0 and word1[i]==word2[j]):\n                dp[i]+=1\n                j-=1\n        ans=[]\n        found= False\n        i=0\n        j=0\n        k=m\n        while(i<n and j<m):\n            if word1[i]==word2[j]:\n                ans.append(i)\n                i+=1\n                j+=1\n                k-=1\n            else:\n                if k-1<=dp[i+1] and found==False:\n                    ans.append(i)\n                    i+=1\n                    j+=1\n                    k-=1\n                    found=True\n                else:\n                    i+=1\n        if(len(ans) == m):\n            return ans\n        else:\n            return []\n\n        \n\n                \n```
['Python3']