Practice Maximum Points in an Archery Competition
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Maximum Points in an Archery Competition
Problem Statement
aliceArrows[k] records Alice arrows in scoring section k, for k from 0 through 11. Allocate exactly numArrows Bob arrows among these sections. Bob earns k points only when he shoots strictly more arrows there than Alice; a tie favors Alice, and a section with no arrows awards neither player points. Return any allocation array maximizing Bob total points.
Source: Maximum Points in an Archery Competition on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
numArrows = 9, aliceArrows = [1,1,0,1,0,0,2,1,0,1,2,0]
[0,0,0,0,1,1,0,0,1,2,3,1]
# Example 2
numArrows = 3, aliceArrows = [0,0,1,0,0,0,0,0,0,0,0,2]
[0,0,0,0,0,0,0,0,1,1,1,0]
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Points in an Archery Competition.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.