Exercise: Reverse a Hash

Try to convert a hash keys to values and values to keys.

Problem statement

In this challenge, you will invert a hash. That is, you will make a new hash with values as keys and keys as values. There is an easy way to do it using the reverse function that takes advantage of the implicit conversion of hash as an alternative list of keys and values, but use an alternative way to this.

Get hands-on with 1400+ tech skills courses.