Skip to content

Commit

Permalink
Create breakingTheRecords.py
Browse files Browse the repository at this point in the history
  • Loading branch information
GJAnsah authored Dec 27, 2019
1 parent b1e069e commit 6aeef49
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions breakingTheRecords.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

Website: https://www.hackerrank.com/challenges/breaking-best-and-worst-records/copy-from/135670262

import math
import os
import random
import re
import sys



n = int(input())

scores = list(map(int, input().rstrip().split()))

count_min=0
count_max=0
mini=scores[0]
maxi=scores[0]
for i in range (1,n):
if scores[i]<mini:
mini=scores[i]
count_min+=1
elif scores[i]>maxi:
maxi=scores[i]
count_max+=1
else:
continue
print (*[count_max,count_min])

0 comments on commit 6aeef49

Please sign in to comment.