From f5cdd52aa0c8bf1e77892af0912c1f03632786c8 Mon Sep 17 00:00:00 2001 From: lighting9999 <120090117+lighting9999@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:51:49 +0800 Subject: [PATCH] Update roman_numerals.py --- conversions/roman_numerals.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conversions/roman_numerals.py b/conversions/roman_numerals.py index 7aacae52c..2d7a10c6c 100644 --- a/conversions/roman_numerals.py +++ b/conversions/roman_numerals.py @@ -8,8 +8,8 @@ ROMAN = [ ] def roman_to_int(roman: str) -> int: """ - Convert a Roman numeral to an integer, supporting Vinculum notation (underscore _ represents 1000 times). - LeetCode No. 13 Roman to Integer + Convert a Roman numeral to an integer, supporting Vinculum notation (underscore _ represents 1000 times). + LeetCode No. 13 Roman to Integer ​    Given a roman numeral, convert it to an integer. ​    Input is guaranteed to be within the range from 1 to 3999. ​    https://en.wikipedia.org/wiki/Roman_numerals @@ -31,7 +31,7 @@ def roman_to_int(roman: str) -> int: total += vals[roman[i]] i += 1 return total - def int_to_roman(number: int) -> str: + def int_to_roman(number: int) -> str: """ Convert an integer to a Roman numeral, supporting Vinculum notation (underscore _ represents 1000 times).  Given a integer, convert it to an roman numeral. @@ -48,7 +48,7 @@ def roman_to_int(roman: str) -> int: factor, number = divmod(number, arabic) result.append(roman * factor) if number == 0: - reak + break return "".join(result) if __name__ == "__main__":