You are viewing a single comment's thread. Return to all comments →
def getContestsInfo(contests): totalSum = 0 impContests = 0 for i in contests: totalSum = totalSum + i[0] if i[1] == 1: impContests = impContests + 1 return [impContests, totalSum] def luckBalance(k, contests): info = getContestsInfo(contests) impContests, totalSum = info[0], info[1] contests = sorted(contests) winContests = impContests - k for i in contests: if winContests <= 0: break if i[1] == 1: totalSum = totalSum - (2*i[0]) winContests = winContests - 1 return totalSum
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 →