shortestWordDifference.js

@@ -1,26 +1,433 @@
-shortestWordDifference.js
+// Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list.%0A%0A// For example,%0A// Assume that words = %5B%22practice%22, %22makes%22, %22perfect%22, %22coding%22, %22makes%22%5D.%0A%0A// Given word1 = %E2%80%9Ccoding%E2%80%9D, word2 = %E2%80%9Cpractice%E2%80%9D, return 3.%0A// Given word1 = %22makes%22, word2 = %22coding%22, return 1.%0A%0A// Note:%0A// You may assume that word1 does not equal to word2, and word1 and word2 are both in the list.
 %0A

add description