Python Practice Programming Module 11-5 Finding the Second Largest Value in an Array

preview_player
Показать описание

In this video, we look at how to solve a common interview question - how to find the second largest element in a list/array. We look at two methods, one if you are allowed to sort the list, and one if you aren't.

00:00 - Introduction
03:23 - What if you're not allowed to sort
Рекомендации по теме
Комментарии
Автор

Hi Prof. Wimberly.
The following code also will work

numbers.sort()
print(numbers[-2])

I love the mantra that "the best way to get better at programming is to practice. How can I improve my logic skills besides practicing?

NONAMEAltangarid