99def roman_to_int (roman : str ) -> int :
1010 """
1111 Convert a Roman numeral to an integer, supporting Vinculum notation (underscore _ represents 1000 times).
12- LeetCode No. 13 Roman to Integer
13- Given a roman numeral, convert it to an integer.
14- Input is guaranteed to be within the range from 1 to 3999.
15- https://en.wikipedia.org/wiki/Roman_numerals
12+ LeetCode No. 13 Roman to Integer
13+ Given a roman numeral, convert it to an integer.
14+ Input is guaranteed to be within the range from 1 to 3999.
15+ https://en.wikipedia.org/wiki/Roman_numerals
1616 >>> all(roman_to_int(key) == value for key, value in tests.items())
1717 >>> tests = {"III": 3, "CLIV": 154, "MIX": 1009, "MMD": 2500, "MMMCMXCIX": 3999, "I_V_": 4000, "X_": 10000, "M_": 1000000}
1818 >>> all(roman_to_int(key) == value for key, value in tests.items())
@@ -34,7 +34,7 @@ def roman_to_int(roman: str) -> int:
3434 def int_to_roman (number : int ) -> str :
3535 """
3636 Convert an integer to a Roman numeral, supporting Vinculum notation (underscore _ represents 1000 times).
37- Given a integer, convert it to an roman numeral.
37+ Given a integer, convert it to an roman numeral.
3838 https://en.wikipedia.org/wiki/Roman_numerals
3939 >>> tests = {"III": 3, "CLIV": 154, "MIX": 1009, "MMD": 2500, "MMMCMXCIX": 3999, "I_V_": 4000, "X_": 10000, "M_": 1000000}
4040 >>> all(int_to_roman(value) == key for key, value in tests.items())
0 commit comments