We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def breakingRecords(scores):
# Write your code here
max1=[]
min1=[]
cmax=cmin=0
h=[]
l=[]
for i in scores:
max1.append(i)
min1.append(i)
h.append(max(max1))
l.append(min(min1))
for i in range(len(h)-1):
if h[i]!=h[i+1]:
cmax+=1
if l[i]!=l[i+1]:
cmin+=1
return cmax,cmin
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
def breakingRecords(scores): # Write your code here max1=[] min1=[] cmax=cmin=0 h=[] l=[] for i in scores: max1.append(i) min1.append(i) h.append(max(max1)) l.append(min(min1)) for i in range(len(h)-1): if h[i]!=h[i+1]: cmax+=1