Interview Query

Dictionary Unique Values

Start Timer

0:00:00

Upvote
8
Downvote
Save question
Mark as completed
View comments (14)
Next question

You are given a dictionary with a key-value of {string: number} where values in the dictionary could be duplicates. You are required to extract the unique values from the dictionary where the value occurred only once.

Return a list of values where they occur only once.

Note: You can return the values in any order.

Input:

dictionary = {"key1": 1, "key2": 1, "key3": 7, "key4": 3, "key5": 4, "key6": 7}

Output:

find_unique_values(dictionary) -> [3,4]

#Only 3 and 4 occurred once.
.
.
.
.
.


Comments

Loading comments