Skip to content

Commit c68a834

Browse files
solves find the runnner up score
1 parent 96b8c94 commit c68a834

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/problem
2+
3+
4+
def second_highest(array):
5+
array.sort()
6+
maximum = array[len(array) - 1]
7+
for i in range(len(array)):
8+
if array[len(array) - 1 - i] < maximum:
9+
return array[len(array) - 1 - i]
10+
11+
12+
n = int(input())
13+
array = list(map(int, input().split()))
14+
print(second_highest(array))

0 commit comments

Comments
 (0)