r/PythonLearning • u/RegularBother614 • 13d 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!
88
Upvotes
View all comments
Show parent comment
3
u/Vigintillionn 13d ago
well, to be honest, their solution is more efficient being O(3n) ~ O(n) while yours is O(nlogn). Not that it makes much of a difference, for small lists O(nlogn) might even beat theirs but asymptotically theirs is more efficient