Given a string and two words which are present in the string, find the minimum distance between the words
Example:
"the brown quick frog quick the", "the" "quick"
Min Distance: 1
"the quick the brown quick brown the frog", "the" "brown"
Min Distance: 2
C/Java code would be helpful?