#20Ancient Roman Inscription
A Roman scribe is preparing inscriptions for important monuments across the empire. Instead of writing numbers using modern decimal notation, the scribe uses an ancient system of seven symbols.
Symbol → Value: I→ 1, V→ 5, X→ 10, L→ 50, C→ 100, D→ 500, M→ 1000
Roman inscriptions are written from the largest value to the smallest. For certain values, a subtractive form is used: 4 → IV 9 → IX 40 → XL 90 → XC 400 → CD 900 → CM
Given an integer num, help the Roman scribe convert it into its correct inscription.
Examples
Example 1
Input: num = 2468
Output: MMCDLXVIII
Explanation: 2000 = MM 400 = CD 60 = LX 8 = VIII Therfore: 2468 → MMCDLXVIII
Example 2
Input: num = 73
Output: LXXIII
Explanation: 70 = LXX 3 = III
Example 3
Input: num = 944
Output: CMXLIV
Explanation: 900 = CM 40 = XL 4 = IV
Constraints
- 1 ≤ num ≤ 3999
- num is a positive integer.
- The resulting Roman numeral contains only the characters I, V, X, L, C, D, M.
