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.
Here is my code, I want to give credit for you and to get through the submission. My code passed 70% of the test cases. I tried my best and really took time for this. Thank you
scores=[3,4,21,36,10,28,35,5,24,42]defbreakingRecords(scores):records=[]highest_scores=[]len_arr=len(scores)-1i=0count=1whilei<len_arr:try:ifscores[i+count]>scores[i]:highest_scores.append(scores[i+count])except:passi+=1count+=1records.append(len(highest_scores))#print(records[0])lowest_scores=[]forninscores:ifn<scores[0]:lowest_scores.append(n)#elif n > scores[0]:#pass#else:#lowest_count = 0#print(lowest_count)#print([x for x in lowest_scores])new_set=set(lowest_scores)#print(len(new_set))records.append(len(new_set))returnrecords
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 →
Here is my code, I want to give credit for you and to get through the submission. My code passed 70% of the test cases. I tried my best and really took time for this. Thank you