← 返回 amazon 的题目列表Minimum Points to Pass the Games
类型:online_judge
amazon
Design a game where a player needs to pass n rounds sequentially. Each round's score is represented as an integer array scores, which can have negative values. The rule is: in any round, the player's accumulated score must be greater than zero to pass. Write a function def min_points_to_pass(scores: List[int]) -> int: to calculate the minimum initial points required for the player to pass all rounds. For example, given scores = [1, 2, 6, 7], the function should return 5 indicating at least 5 initial points are needed to pass all rounds.
Example
Input
[1, 2, 6, 7]