Previous question · 669
Companies With 3+ Speakers
easyDatabase
Next question · 671
Avg Days Between Stays
mediumDatabase
Random coding question

670. Invert a Dictionary

medium
GeneralGeneral
entry
Function contract
Inputs
d
dict
Returns
value
dict

Examples

Input
{
  "d": {
    "w": "blue",
    "x": "red",
    "y": "blue",
    "z": "red"
  }
}
Output
{
  "red": [
    "x",
    "z"
  ],
  "blue": [
    "w",
    "y"
  ]
}

Constraints

Hint 1
Hint 2
Hint 3
Roles
Software Engineer
ML Engineer
Data Engineer
Quantitative Researcher
Research Scientist
Companies
GeneralGeneral
Levels
entry
Tags
python

Similar Questions

Custom Sort Stringmedium
Algorithms
Number of 1 Bitseasy
Algorithms
Letter Case Permutationmedium
Algorithms
33 people are solving this problem
Loading editor for the selected language
Ln 1, Col 1
Program Output
DATAINTERVIEW
Interactive coding terminal
Python environment ready.
Type a command below or run code from the editor.
run scriptExecute the current editor contents
submitGrade the current editor contents against all solution test cases
python ("print hello world")Run an isolated Python command
helpShow all available commands