Skip to content

Commit f5cdd52

Browse files
authored
Update roman_numerals.py
1 parent 1e48591 commit f5cdd52

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

conversions/roman_numerals.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
]
99
def roman_to_int(roman: str) -> int:
1010
"""
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
1313
​    Given a roman numeral, convert it to an integer.
1414
​    Input is guaranteed to be within the range from 1 to 3999.
1515
​    https://en.wikipedia.org/wiki/Roman_numerals
@@ -31,7 +31,7 @@ def roman_to_int(roman: str) -> int:
3131
total += vals[roman[i]]
3232
i += 1
3333
return total
34-
def int_to_roman(number: int) -> str:
34+
def int_to_roman(number: int) -> str:
3535
"""
3636
Convert an integer to a Roman numeral, supporting Vinculum notation (underscore _ represents 1000 times).
3737
 Given a integer, convert it to an roman numeral.
@@ -48,7 +48,7 @@ def int_to_roman(number: int) -> str:
4848
factor, number = divmod(number, arabic)
4949
result.append(roman * factor)
5050
if number == 0:
51-
reak
51+
break
5252
return "".join(result)
5353

5454
if __name__ == "__main__":

0 commit comments

Comments
 (0)