-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
https://leetcode.com/problems/shortest-word-distance-iii
Burada, bir string listesi (wordsDict) veriliyor.
İki tane de ayrı string (word1, word2 ) veriliyor.
Bu stringlerin listede birbirlerine olan uzaklıklarını hesaplamamız isteniyor.
Eğer herhangi bir sözcük listede tekrar ediyorsa, birden fazla uzaklık bulunacaktır.
Bizden istenen en kısa uzaklığı bulmamız.
Not: word1 ve word2 aynı stringe eşit olabilir.
Input: wordsDict = ["practice", "makes", "perfect", "coding", "makes"],
word1 = "makes", word2 = "coding"
Output: 1
Metadata
Metadata
Assignees
Labels
No labels