1258. Synonymous Sentences
https://leetcode.com/problems/synonymous-sentences
Description
You are given a list of equivalent string pairs synonyms
where synonyms[i] = [si, ti]
indicates that si
and ti
are equivalent strings. You are also given a sentence text
.
Return all possible synonymous sentences sorted lexicographically.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
0 <= synonyms.length <= 10
synonyms[i].length == 2
1 <= si.length,ti.length <= 10
si != ti
text
consists of at most10
words.The words of
text
are separated by single spaces.
ac
Last updated