μ μΌνκ² λ±μ₯νλ λ¨μ΄ μ°ΎκΈ° - λ¬Έμ νμ΄
μ μΌνκ² λ±μ₯νλ λ¨μ΄λ₯Ό μ°Ύλ 3κ°μ§ λ°©λ²μ νμΈν΄ 보μΈμ.
λ°©λ² 1
def solution(words): word_count = {} for word in words: if word in word_count: word_count[word] += 1 else: word_count[word] = 1 return [word for word in words if word_count[word] == 1]
μ¬μ© μμ
μ
μΆλ ₯ μμ
result = solution(["apple", "banana", "apple", "orange"]) print(result) # μΆλ ₯: ["banana", "orange"]
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help