Last active
December 17, 2017 11:14
-
-
Save empeje/617433053ef58994b81048963a7a13ab to your computer and use it in GitHub Desktop.
[SNIPPET-20] HackerRank - Breaking the Records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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