• + 0 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

    scores = [3,4,21,36,10,28,35,5,24,42]
    def breakingRecords(scores):
      records = []
      highest_scores = []
      len_arr = len(scores) - 1
      i = 0
      count = 1
      while i < len_arr:
        try:
          if scores[i+count] > scores[i]:
            highest_scores.append(scores[i+count])
        except:
          pass
        i+=1
        count+=1
    
      records.append(len(highest_scores))
      #print(records[0])
    
      lowest_scores = []
      for n in scores:
        if n < 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))
      return records