Swap keys and values
easyDictionaries10 XP
d maps strings to strings, and no two keys share a value. Return a new dictionary (JavaScript: object) that maps each value back to its key.
Examples
- Input: d = {"a": "one", "b": "two"}Output: {"one": "a", "two": "b"}
- Input: d = {}Output: {}
Examples use JSON: true/false/null are True/False/None in Python.