Shortest Word Distance in a String Array

Asked at Uber · Coding Questions · Difficulty: Easy · Last asked Mar 13, 2026

You are given an array of strings `wordsDict` and two different strings `word1` and `word2` that both appear in the array.

Loading the problem…