Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0e6708e

Browse files
authored
Solution
1 parent 1236767 commit 0e6708e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /