Given an array of strings wordsDict and two different strings word1 and word2 that both exist in wordsDict, return the minimum absolute index difference between any occurrence of word1 and any occurrence of word2 in the array.
Constraints:
wordsDict.length
wordsDict[i].length
wordsDict[i] consists of lowercase English letters.
word1 and word2 are in wordsDict.
word1 word2
Given an array of strings wordsDict and two different strings word1 and word2 that both exist in wordsDict, return the minimum absolute index difference between any occurrence of word1 and any occurrence of word2 in the array.
Constraints:
wordsDict.length
wordsDict[i].length
wordsDict[i] consists of lowercase English letters.
word1 and word2 are in wordsDict.
word1 word2