File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 8
8
]
9
9
def roman_to_int (roman : str ) -> int :
10
10
"""
11
- Convert a Roman numeral to an integer, supporting Vinculum notation (underscore _ represents 1000 times).
12
- LeetCode No. 13 Roman to Integer
11
+ Convert a Roman numeral to an integer, supporting Vinculum notation (underscore _ represents 1000 times).
12
+ LeetCode No. 13 Roman to Integer
13
13
Given a roman numeral, convert it to an integer.
14
14
Input is guaranteed to be within the range from 1 to 3999.
15
15
https://en.wikipedia.org/wiki/Roman_numerals
@@ -31,7 +31,7 @@ def roman_to_int(roman: str) -> int:
31
31
total += vals [roman [i ]]
32
32
i += 1
33
33
return total
34
- def int_to_roman (number : int ) -> str :
34
+ def int_to_roman (number : int ) -> str :
35
35
"""
36
36
Convert an integer to a Roman numeral, supporting Vinculum notation (underscore _ represents 1000 times).
37
37
Given a integer, convert it to an roman numeral.
@@ -48,7 +48,7 @@ def int_to_roman(number: int) -> str:
48
48
factor , number = divmod (number , arabic )
49
49
result .append (roman * factor )
50
50
if number == 0 :
51
- reak
51
+ break
52
52
return "" .join (result )
53
53
54
54
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments