21 August 2026
First Unique Word
Hard
Strings
Dictionaries
Find the first word in a sentence that appears only once.
Given a sentence, return the first word that appears exactly once. Ignore letter case and punctuation when comparing words. A word is a consecutive run of English letters. Return the word in lowercase, or return None if every word appears more than once or the sentence contains no words.
Constraints
0 <= len(sentence) <= 1000sentence contains English letters, whitespace, and punctuationCompare words without letter case or punctuationReturn the result in lowercase
Function signature
def first_unique_word(sentence):