This commit is contained in:
louiscklaw
2025-01-31 21:15:04 +08:00
parent 3337cc3d1e
commit acf9d862ff
324 changed files with 43162 additions and 0 deletions

10
max015/T11/P05.py Normal file
View File

@@ -0,0 +1,10 @@
def myFunction(n):
for i in range(n): # O(n)
for j in range(i, i * i): # O(i^2 - i) => O(n^2 - n) => O(n^2)
if j % i == 0: # O(1) # Check if j is divisible by i
for k in range(j): # O(n!)
print("*", end="") # Print '*' to the console without newline
print()
# Example usage
myFunction(5)