Minimum distance between the given two words
Given a list of words followed by two words, the task is to find the minimum distance between the given two words in the list of words.Examples:Input: S = { "the", "quick", "brown", "fox", "quick"}, word1 = "the", word2 = "fox"Output: 3Explanation: Minimum distance between the words "the" and "fox"