0

How to find second largest no. in an array?

in c++

27th Aug 2017, 7:14 PM
Sourabh
3 Respostas
+ 5
If it contains unique values only: print(sorted(list_name)[-2])
27th Aug 2017, 7:20 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
Sort it and pick the 2nd element. Simple.
28th Aug 2017, 12:18 AM
Haris
Haris - avatar