Skip to content

Instantly share code, notes, and snippets.

@empeje
Last active December 17, 2017 11:14
Show Gist options
  • Save empeje/617433053ef58994b81048963a7a13ab to your computer and use it in GitHub Desktop.
Save empeje/617433053ef58994b81048963a7a13ab to your computer and use it in GitHub Desktop.
[SNIPPET-20] HackerRank - Breaking the Records
#!/bin/python3
import sys
n = int(input().strip())
scores = list(map(int, input().strip().split(' ')))
# your code goes here
# highest score
max = -float("inf")
max_count = -1
min = float("inf")
min_count = -1
for score in scores:
if score > max:
max = score
max_count += 1
for score in scores:
if score < min:
min = score
min_count += 1
print(max_count, min_count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment