Given an array of strings
wordsDict
and two different strings that already exist in the arrayword1
andword2
, return the shortest distance between these two words in the list.
1 | class Solution { |
Given an array of strings
wordsDict
and two different strings that already exist in the arrayword1
andword2
, return the shortest distance between these two words in the list.
1 | class Solution { |