Search
⌘K

Leetcode 2822. Inversion of Object

Given an object mapping keys to values, return a new object with keys and values swapped. If multiple original keys share the same value, aggregate those keys into an array under the inverted key to handle collisions.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.