r/PythonLearning • u/RegularBother614 • 12d ago
What do you guys think?
I made a program that finds the second largest digit in a list.
Using the list method "remove()" and "max" function. Python is COOL!
86
Upvotes
View all comments
Show parent comment
0
u/sexiestsaxiestman 11d ago
Haha, no problem. Basically n is the number of elements in your list in this case. Time complexity is related to how many operations the solution requires. Something like max(list) would be O(n) since it has to check every element in the list once (n operations).