You are viewing a single comment's thread. Return to all comments →
def luckBalance(k, contests): all_l = 0 ls_ls = [] for row in contests: if row[1] == 0: all_l += row[0] elif row[1] == 1: ls_ls.append(row[0]) ls_ls = sorted(ls_ls, reverse=True) all_l = all_l + sum(ls_ls[:k]) - sum(ls_ls[k:]) return all_l
Seems like cookies are disabled on this browser, please enable them to open this website
Luck Balance
You are viewing a single comment's thread. Return to all comments →