Question: JavaScript Related Questions: 1. Given two strings S and T, determine if they are both one edit distance apart. And explain . 2. Given a

JavaScript Related Questions:

1. Given two strings S and T, determine if they are both one edit distance apart. And explain.

2.

Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. And explain.

For example,

Assume that words = ["practice", "makes", "perfect", "coding", "makes"].

Given word1 = coding, word2 = practice, return 3.

Given word1 = "makes", word2 = "coding", return 1.

Note:

You may assume that word1 does not equal to word2, and word1 and word2 are both in the list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!