Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions solutions/009_Find_the_Runner_Up_Score.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,19 @@ arr = list(arr)
new_arr = remove_n(arr, max(arr))
print(max(new_arr))
```

##Solution 5
...
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
l=[]
l=list(arr)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! Your solution is correct, but we can make a few improvements. You define l twice as list you don't need that. In fact, doing as in the example below where you define arr can further simplify your code.

arr = list(map(int, input().split()))

l.sort(reverse=True)
a=l[0]
for i in range (1,n):
if l[i]<a:
b=l[i]
print(int(b))
break
...