You are viewing a single comment's thread. Return to all comments →
hello hackerrank citizens, this is my answer using python, can I upgrade the code to make it more efficient and clean?
def breakingRecords(scores): batas_atas = scores[0] batas_bawah = scores[0] best = [] worse = []
for score in scores: if (score > batas_atas): best.append(score) batas_atas = score elif (score < batas_bawah): worse.append(score) batas_bawah = score result = [len(best), len(worse)] return result;
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 →
hello hackerrank citizens, this is my answer using python, can I upgrade the code to make it more efficient and clean?
def breakingRecords(scores): batas_atas = scores[0] batas_bawah = scores[0] best = [] worse = []