Medium · Math

Convert Integer to Roman Numeral

Given an integer num between 1 and 3999, return its standard Roman numeral (symbols I, V, X, L, C, D, M, with the subtractive forms IV, IX, XL, XC, CD and CM).

Examples

Example 1

{
  "num": 1994
}

Output: MCMXCIV

Example 2

{
  "num": 58
}

Output: LVIII

Rebuild it in the studio

Open every published interview problem, solution, scene, and memory room free, with no account.

More Math problems