NeetCode #164LC-1258MediumArrays & Hashing
← Back to All Problems#164 · #1258 · Synonymous Sentences(近义词句子)
📌 Problem Statement & Constraints
Given a list of synonym pairs and a sentence
text, generate all possible sentences by replacing words with their synonyms. Return the results sorted lexicographically. Constraints: 0 <= synonyms.length <= 10, 1 <= text.length <= 10; synonym pairs are symmetric and transitive.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!