You are viewing a single comment's thread. Return to all comments →
A slightly more python way -
def luckBalance(k, contests): total_luck = 0 for luck,important in sorted(contests, reverse=True): if not important: total_luck += luck elif k: total_luck += luck k -= 1 else: total_luck -= luck return total_luck
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 →
A slightly more python way -