Ctrl K

A Bonus to Take the Lead

Easy
Several players are in a game, and points[i] is the current score of player i. The host holds bonus prize points and may hand all of them to a single player. For each player, decide: if that player received every prize point, would they have the highest score of everyone? The other players keep their scores. Sharing first place counts. Return a list of booleans with the same length as points.
Example 1
points=[4, 7, 2, 6], bonus=3 → [True, True, False, True]

4 + 3 = 7 ties the leader, which still counts as first place. 2 + 3 = 5 < 7, while 6 + 3 = 9 takes the lead.

Example 2
points=[10, 1, 3], bonus=5 → [True, False, False]

Nobody except the leader can reach 10 points.

Example 3
points=[5, 5], bonus=1 → [True, True]
Constraints
  • 2 ≤ len(points) ≤ 100
  • 1 ≤ points[i] ≤ 100
  • 1 ≤ bonus ≤ 50
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsPair With a Target Sum EasySqueeze Repeats Out of a Sorted Array EasyDrop the Unwanted Value EasySlot on a Sorted Shelf EasyAdd One to a Digit Array Easy
loading Python…
Input
points=[4, 7, 2, 6], bonus=3
Expected
[True, True, False, True]

Run checks the first 3 tests in your browser. Submit checks all 74 tests on the server, hidden ones included.