#91
Dictionary Key-Value Inversion
EASYHash Tablepython
Problem Description
A data transformation job reverses a lookup table to build a bidirectional key-value index for faster reverse lookups in a dimension store. Given a dictionary `inp_dict` with string keys and string values, return a new dictionary where keys and values are swapped.
**Task:** Invert the dictionary so original values become keys and original keys become values.
**Key Rules:**
- If duplicate values exist in the input, the **last occurrence's** key wins in the output.
**Constraints:**
- `0 <= len(inp_dict) <= 10,000`
- Keys and values are non-empty strings.
Topics
hash tabledictionarystring processingdata structures
Asked at Companies
cisco
Solve This Problem
Sign up to access the interactive code editor, run test cases, view the editorial, and get AI-powered feedback on your solution.
Start Solving →