Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Thanks stackoverflow solution in Speedy category for Roman Numerals by Stensen
rep = [["I"*5, "V"], ["V"*2, "X"], ["X"*5, "L"], ["L"*2, "C"],
["C"*5, "D"], ["D"*2, "M"], ["DCCCC", "CM"], ["CCCC", "CD"],
["LXXXX", "XC"], ["XXXX", "XL"], ["VIIII", "IX"], ["IIII", "IV"]]
def checkio(data):
st = "I"*data
for r in rep: st = st.replace(*r);
return st;
Sept. 23, 2020
Comments: