You are viewing a single comment's thread. Return to all comments →
def luckBalance(k, contests): importants = sorted((c for c in contests if c[1]), key=lambda x: x[0], reverse=True) unimportants = sorted((c for c in contests if not c[1])) return ( sum((c[0] for c in unimportants)) + sum((c[0] for c in importants[:k])) - sum((c[0] for c in importants[k:])) )
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 →