code: def compute_rewards(self, scores):
          
          if len(scores) > self.k:
              scores = np.copy(scores)
              inds = np.argsort(scores)[:-self.k]
              scores[inds] = np.nan
  
          return list(scores)
docs: Retain the K best scores, and replace the rest with nans