Skip to content

Commit ad28671

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent eb8598f commit ad28671

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

conversions/roman_numerals.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
]
99
def roman_to_int(roman: str) -> int:
1010
"""
11-
Convert a Roman numeral to an integer, supporting Vinculum notation
11+
Convert a Roman numeral to an integer, supporting Vinculum notation
1212
(underscore _ represents 1000 times).
1313
1414
LeetCode No. 13 Roman to Integer:
@@ -26,7 +26,7 @@ def roman_to_int(roman: str) -> int:
2626
"I_": 1000, "V_": 5000, "X_": 10000, "L_": 50000, "C_": 100000,
2727
"D_": 500000, "M_": 1000000
2828
}
29-
29+
3030
i, total = 0, 0
3131
while i < len(roman):
3232
if i + 1 < len(roman) and roman[i:i+2] in vals:
@@ -36,11 +36,11 @@ def roman_to_int(roman: str) -> int:
3636
total += vals[roman[i]]
3737
i += 1
3838
return total
39-
39+
4040

4141
def int_to_roman(number: int) -> str:
4242
"""
43-
Convert an integer to a Roman numeral, supporting Vinculum notation
43+
Convert an integer to a Roman numeral, supporting Vinculum notation
4444
(underscore _ represents 1000 times).
4545
4646
Given an integer, convert it to a Roman numeral.
@@ -61,7 +61,7 @@ def int_to_roman(number: int) -> str:
6161
if number == 0:
6262
break
6363
return "".join(result)
64-
64+
6565
if __name__ == "__main__":
6666
import doctest
6767
doctest.testmod()

0 commit comments

Comments
 (0)