Hashtags used only once

Write code · Basic · §4.3 Counting occurrences

tags holds the hashtags that one person has used in their posts so far, in the order they were used. The # sign in front of each hashtag is left out.

Complete the function solution, which returns a list of the hashtags that were used exactly once, in the order they appear in tags. If there is no such hashtag, return an empty list.

Function

solution(tags)

Constraints

Examples

tagsresult
['daily', 'cafe', 'daily', 'ootd']['cafe', 'ootd']
['travel', 'travel'][]

Starter code

def solution(tags):
    answer = []
    return answer

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.