File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 88]
99def 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
5454if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments