LinkedIn interview question

Data structures and algorithms. Shortest distance btw words in an array