Recursive, two pointer, greedy
Intuition \n- If one char must replace, then it should be as early as possible\n- If current word1Char <> word2Char, then it must replace, and do recursive, if 
# Intuition \n- If one char must replace, then it should be as early as possible\n- If current word1Char <> word2Char, then it must replace, and do recursive, if it return result, then it must be the answer, because it is earliest answer that we found\n - If it not, find the index of word1 that match current index of word2 and do recursive\n# Code\n```golang []\nfunc validSequence(word1 string, word2 string) []int {\n\tpaths := []int{}\n\tif !recur(word1, word2, 0, 0, &paths, false) {\n\t\treturn nil\n\t}\n\treturn paths\n}\n\nfunc recur(word1 string, word2 string, w1i, w2i int, paths *[]int, hasReplace bool) bool {\n\tif w2i == len(word2) {\n\t\treturn true\n\t}\n\tif len(word1)-w1i < len(word2)-w2i {\n\t\treturn false\n\t}\n\n\tpathLen := len(*paths)\n\tif word1[w1i] == word2[w2i] {\n\t\t// pick\n\t\t*paths = append(*paths, w1i)\n\t\treturn recur(word1, word2, w1i+1, w2i+1, paths, hasReplace)\n\t}\n\n\t// try to choose\n\tif !hasReplace {\n\t\t*paths = append(*paths, w1i)\n\t\tif recur(word1, word2, w1i+1, w2i+1, paths, true) {\n\t\t\treturn true\n\t\t}\n\t\t*paths = (*paths)[:pathLen]\n\t}\n\n\t// skip to match word\n\tfor w1i < len(word1) && word1[w1i] != word2[w2i] {\n\t\tw1i++\n\t}\n\treturn recur(word1, word2, w1i, w2i, paths, hasReplace)\n}\n\n```
['Two Pointers', 'Greedy', 'Recursion', 'Go']