Skip to content

Commit

Permalink
problem 5 (Find the Runner-Up Score) updated
Browse files Browse the repository at this point in the history
  • Loading branch information
well-balanced committed Oct 24, 2019
1 parent 5c9ab44 commit e58738e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions problem_5.py
@@ -0,0 +1,10 @@
if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
winner = max(arr)
i = 0
while i<n:
if winner == max(arr):
arr.remove(max(arr))
i = i+1
print(max(arr))
7 changes: 7 additions & 0 deletions test.py
@@ -0,0 +1,7 @@
i = int(input())
lis = list(map(int,raw_input().strip().split()))[:i]
z = max(lis)
while max(lis) == z:
lis.remove(max(lis))

print (max(lis))

0 comments on commit e58738e

Please sign in to comment.