This may be very simple, but I don't know all of Ruby's array functions.
If I have a given array like:
values = [["a", 1], ["b", 3], ["c", 7], ... etc ]
I would like two functions:
- A function that, when I give it "b", gives me 3.
- The other way around, a function that when I give it 3, gives me "b".
There must be an easy way?