Build a year from its place values
Example input
2026Expected result
MMXXVITwo M symbols provide 2,000, two X symbols provide 20, V provides five and I provides one. Reverse the direction and decode MMXXVI to recover 2026. For numbers such as four or nine, the standard output uses IV and IX. The decoder checks the supported conventional form rather than accepting every arbitrary sum of Roman letters.