We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65ddf44 commit ef8c7b3Copy full SHA for ef8c7b3
src/main/java/com/fishercoder/solutions/_244.java
@@ -24,6 +24,7 @@ public class _244 {
24
public static class Solution1 {
25
class WordDistance {
26
private Map<String, List<Integer>> map;
27
+
28
public WordDistance(String[] words) {
29
map = new HashMap<>();
30
for (int i = 0; i < words.length; i++) {
@@ -37,6 +38,7 @@ public WordDistance(String[] words) {
37
38
}
39
40
41
42
public int shortest(String word1, String word2) {
43
List<Integer> list1 = map.get(word1);
44
List<Integer> list2 = map.get(word2);
0 commit comments