Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Team Play by hkgok1
from typing import List
from itertools import combinations
def max_score(cut: List[int], bend: List[int], k: int) -> int:
#replace this for solution
res = sorted([c-b for c,b in zip(cut,bend)])
res = res[-k:]
return sum(bend+res)
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
print("Example:")
print(max_score([4, 2, 1], [2, 5, 3], 2))
assert max_score([4, 2, 1], [2, 5, 3], 2) == 10, "Your team can do better."
assert max_score([7, 1, 4, 4], [5, 3, 4, 3], 2) == 18, "Bet you can improve this."
assert max_score([5, 5, 5], [5, 5, 5], 1) == 15, "Almost there!"
print("Coding complete? Click 'Check' to earn cool rewards!")
June 17, 2022
Comments: