Largest buff card score
A card game applies a run of buff cards to one hero. Buff i multiplies the hero's score by multipliers[i] and then adds bonuses[i] on top. Every buff in the hand is played exactly once and you choose the order. Scores are whole numbers, every multiplier is at least 1, and every bonus is at least 1. The hero starts on base_score. Return the largest score the hand can end on. The two lists have the same length, and an empty hand leaves the hero on base_score. Playing the biggest multiplier first is not the answer, and neither is playing the biggest bonus first.
max_buffed_score(base_score: int, multipliers: list[int], bonuses: list[int]) → int[0,[2,3],[1,1]]out4[5,[1,4],[7,2]]out50State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
[0,[2,3],[1,1]]4not run yetsample[5,[1,4],[7,2]]50not run yetsample