#104
Write Roman Numerals
Difficulty: | Medium |
Topics: | strings math |
This is the inverse of Problem 92, but much easier.
Given an integer smaller than 4000,
return the corresponding roman numeral in uppercase,
adhering to the subtractive principle.
(= "I" (__ 1)) | |
(= "I" (__ 1)) | |
(= "XXX" (__ 30)) | |
(= "IV" (__ 4)) | |
(= "CXL" (__ 140)) | |
(= "DCCCXXVII" (__ 827)) | |
(= "MMMCMXCIX" (__ 3999)) | |
(= "XLVIII" (__ 48)) |