We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1236767 commit 0e6708eCopy full SHA for 0e6708e
HackerRank-Breaking the Records/Breaking_the_Records.py
@@ -0,0 +1,36 @@
1
+#!/bin/python3
2
+
3
+import math
4
+import os
5
+import random
6
+import re
7
+import sys
8
9
+# Complete the breakingRecords function below.
10
+def breakingRecords(scores):
11
+ maxi=scores[0]
12
+ mini=scores[0]
13
+ maxcount =0
14
+ mincount=0
15
+ for i in range(len(scores)):
16
+ if(scores[i]>maxi):
17
+ maxi = scores[i]
18
+ maxcount+=1
19
+ if(scores[i]<mini):
20
+ mini = scores[i]
21
+ mincount+=1
22
+ return [maxcount, mincount]
23
24
+if __name__ == '__main__':
25
+ fptr = open(os.environ['OUTPUT_PATH'], 'w')
26
27
+ n = int(input())
28
29
+ scores = list(map(int, input().rstrip().split()))
30
31
+ result = breakingRecords(scores)
32
33
+ fptr.write(' '.join(map(str, result)))
34
+ fptr.write('\n')
35
36
+ fptr.close()
0 commit comments