Skip to content

Commit 12b2b89

Browse files
refactor 737
1 parent fb08410 commit 12b2b89

File tree

1 file changed

+0
-21
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-21
lines changed

src/main/java/com/fishercoder/solutions/_737.java

-21
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,6 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
/**
7-
* 737. Sentence Similarity II
8-
*
9-
* Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are similar.
10-
* For example, words1 = ["great", "acting", "skills"] and words2 = ["fine", "drama", "talent"] are similar,
11-
* if the similar word pairs are pairs = [["great", "good"], ["fine", "good"], ["acting","drama"], ["skills","talent"]].
12-
* Note that the similarity relation is transitive.
13-
*
14-
* For example, if "great" and "good" are similar, and "fine" and "good" are similar, then "great" and "fine" are similar.
15-
* Similarity is also symmetric. For example, "great" and "fine" being similar is the same as "fine" and "great" being similar.
16-
* Also, a word is always similar with itself. For example, the sentences words1 = ["great"], words2 = ["great"], pairs = [] are similar, even though there are no specified similar word pairs.
17-
* Finally, sentences can only be similar if they have the same number of words. So a sentence like words1 = ["great"] can never be similar to words2 = ["doubleplus","good"].
18-
19-
Note:
20-
21-
The length of words1 and words2 will not exceed 1000.
22-
The length of pairs will not exceed 2000.
23-
The length of each pairs[i] will be 2.
24-
The length of each words[i] and pairs[i][j] will be in the range [1, 20].
25-
26-
*/
276
public class _737 {
287
public static class Solution1 {
298
public boolean areSentencesSimilarTwo(String[] words1, String[] words2, String[][] pairs) {

0 commit comments

Comments
 (0)