[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-10-09 10:16:49 +00:00
parent 3913a78ab2
commit b791b0e6d7

View File

@ -27,8 +27,9 @@ O(n) - The algorithm uses an array of size n to store the ugly numbers.
Sources:
- Dynamic Programming and Ugly Numbers: https://www.geeksforgeeks.org/ugly-numbers/
"""
def nth_ugly_number(n: int) -> int:
def nth_ugly_number(n: int) -> int:
"""
Return the nth ugly number.
>>> nth_ugly_number(5)
@ -62,8 +63,8 @@ def nth_ugly_number(n: int) -> int:
return dp[n - 1]
if __name__ == "__main__":
if __name__ == "__main__":
# User input to find the nth Ugly Number
print("\n********* Ugly Numbers Using Dynamic Programming ************\n")
print("\n*** Enter -1 to quit ***")
@ -75,7 +76,6 @@ if __name__ == "__main__":
print("\n********* END ************")
break
else:
ugly_number = nthUglyNumber(n)
print(f"The {n}th Ugly Number is: {ugly_number}")
print("Try another index to find a Ugly Number: ", end="")