In Ruby, write a function transfrom
that will transform numerals to romans and vice versa
For example, given the following input:
["III", 29, 38, "CCXCI", 1999]
The correct output is:
[3, "XXIX", "XXXVIII", 291, "MCMXCIX"]
If you're not familiar with or need a refresher on Roman numerals, the rules are simple. First, there are seven letters associated with seven values:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
You can combine letters to add values, by listing them largest to smallest from left to right:
II is 2
VIII is 8
XXXI is 31