update,
This commit is contained in:
10
max015/T11/P05.py
Normal file
10
max015/T11/P05.py
Normal 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)
|
Reference in New Issue
Block a user