Roman Numerals

Roman numerals still appear in book chapters, clocks, and event numbering. Write a function int_to_roman that converts the integer num into Roman numeral notation. The input number is from 1 to 3999. Return the result as a string made of Roman symbols.

Примеры

Ввод
3
Вывод
"III"
Ввод
58
Вывод
"LVIII"
Ввод
1994
Вывод
"MCMXCIV"

Нужно реализовать

def int_to_roman(num: int) -> str:

Теги

stringsmathhashmap
PostgreSQLv16

Taispeánfar toradh do chóid anseo

Visible tests
1
Input
3
Expected"III"
2
Input
58
Expected"LVIII"
3
Input
1994
Expected"MCMXCIV"
4
Input
4
Expected"IV"
5
Input
3999
Expected"MMMCMXCIX"
6
Input
40
Expected"XL"
Focus radio
Paused · SomaFM · Fluid