@@ -0,0 +1,1554 @@
+public class SentenceSimilarity %7B%0A%0A    //TAG: Google%0A    //Difficulty: Easy%0A%0A    /**%0A     * 734. Sentence Similarity%0A     * 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.%0A%0A     For example, %22great acting skills%22 and %22fine drama talent%22 are similar, if the similar word pairs are pairs = %5B%5B%22great%22, %22fine%22%5D, %5B%22acting%22,%22drama%22%5D, %5B%22skills%22,%22talent%22%5D%5D.%0A%0A     Note that the similarity relation is not transitive. For example, if %22great%22 and %22fine%22 are similar, and %22fine%22 and %22good%22 are similar, %22great%22 and %22good%22 are not necessarily similar.%0A%0A     However, similarity is symmetric. For example, %22great%22 and %22fine%22 being similar is the same as %22fine%22 and %22great%22 being similar.%0A%0A     Also, a word is always similar with itself. For example, the sentences words1 = %5B%22great%22%5D, words2 = %5B%22great%22%5D, pairs = %5B%5D are similar, even though there are no specified similar word pairs.%0A%0A     Finally, sentences can only be similar if they have the same number of words. So a sentence like words1 = %5B%22great%22%5D can never be similar to words2 = %5B%22doubleplus%22,%22good%22%5D.%0A%0A     Note:%0A%0A     The length of words1 and words2 will not exceed 1000.%0A     The length of pairs will not exceed 2000.%0A     The length of each pairs%5Bi%5D will be 2.%0A     The length of each words%5Bi%5D and pairs%5Bi%5D%5Bj%5D will be in the range %5B1, 20%5D.%0A     */%0A%0A    /**%0A     * Solution:%0A     *%0A     */%0A%0A    public boolean areSentencesSimilar(String%5B%5D words1, String%5B%5D words2, String%5B%5D%5B%5D pairs) %7B%0A%0A    %7D%0A%0A%7D%0A

734. Sentence Similarity