Answer the question
In order to leave comments, you need to log in
How to calculate the final difficulty?
There is this code:
#!/usr/bin/env python3
a = [10, 20, 30, 40, 50, 60]
for i in range(len(a)):
print(i, a[i])
len(a) # O(1)
for i in (0, 1, 2, ,3 ,4 ,5) # O(n)
print() # O(1)
total complexity: (O(1) * O( n)) * O(1) = O(n)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question