1258. Synonymous Sentences
Description
**Input:**synonyms = [["happy","joy"],["sad","sorrow"],["joy","cheerful"]],
text = "I am happy today but was sad yesterday"
**Output:**["I am cheerful today but was sad yesterday",
"I am cheerful today but was sorrow yesterday",
"I am happy today but was sad yesterday",
"I am happy today but was sorrow yesterday",
"I am joy today but was sad yesterday",
"I am joy today but was sorrow yesterday"]**Input:** synonyms = [["happy","joy"],["cheerful","glad"]], text = "I am happy today but was sad yesterday"
**Output:** ["I am happy today but was sad yesterday","I am joy today but was sad yesterday"]**Input:** synonyms = [["a","b"],["c","d"],["e","f"]], text = "a c e"
**Output:** ["a c e","a c f","a d e","a d f","b c e","b c f","b d e","b d f"]ac
Last updated