Skip to content

Commit 0037a7a

Browse files
authored
Create Breaking_the_Records.py
1 parent e3b5480 commit 0037a7a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Breaking_the_Records.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/python3
2+
3+
import sys
4+
5+
def getRecord(s):
6+
mi = ma = s[0]
7+
mic = mac = 0
8+
for i in range(len(s)):
9+
if s[i] > ma:
10+
ma = s[i]
11+
mac += 1
12+
if s[i] < mi:
13+
mi = s[i]
14+
mic += 1
15+
return [mac,mic]
16+
n = int(input().strip())
17+
s = list(map(int, input().strip().split(' ')))
18+
result = getRecord(s)
19+
print (" ".join(map(str, result)))

0 commit comments

Comments
 (0)