Question
In a fighting game, each attack in your move list deals a fixed amount of damage, and you may repeat attacks freely. A finishing combo must deal exactly the boss's remaining health — no overkill. Given the list of distinct positive damage values and the boss health, return how many distinct ordered sequences of attacks deal exactly that total. The same attacks in a different order count as different combos. If health is 0, return 1 (the empty combo).
count_finishing_combos(damages: list[int], health: int) → int[[1,2],4]out5[[2,3],7]out3State 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.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.