Find common words in any given two sentences and return them sorted alphabetically.
This question is part of a paid planUnlock the full question bank, official solutions and other users’ approaches.Unlock this question5-day money-back guarantee · Cancel anytime
Constraints
The input variables sentence1 and sentence2 must be of type str.
The input sentences should not be empty.
The sentences can contain any characters, including letters, numbers, punctuation marks, and whitespace.
The sentences can be of any length, from empty strings to very long sentences.
The sentences are case-insensitive, meaning that the comparison of words should be done in a case-insensitive manner.
The sentences can contain duplicate words, but the output set should only contain unique common words.
This question is part of a paid planUnlock the full question bank, official solutions and other users’ approaches.Unlock this question5-day money-back guarantee · Cancel anytime
Common Words in Two Sentences | StrataScratch
This question is part of an interview loop
See the full interview round by round, with questions for each stage.