Minimum Bonus Projects
Updated
Problem statement
You are given an array errorScores of nonnegative employee error scores and two reductions selectedReduction and otherReduction, where selectedReduction > otherReduction.
In one bonus-project operation, choose one employee. That employee's score decreases by selectedReduction, while every other employee's score decreases by otherReduction. A score that would become negative is treated as 0.
Return the minimum number of operations required to reduce every score to 0.
Function
minimumBonusProjects(errorScores: long[], selectedReduction: long, otherReduction: long) → longExamples
Example 1
errorScores = [6,4,1]selectedReduction = 4otherReduction = 1return = 3Three operations suffice. With only two operations, the total number of extra selected reductions required is greater than two.
Example 2
errorScores = [5]selectedReduction = 2otherReduction = 0return = 3The sole employee must be selected three times.
Example 3
errorScores = [3,3]selectedReduction = 3otherReduction = 1return = 2Select each employee once. Each receives one reduction of 3 and one reduction of 1, which is enough to reach zero.
Example 4
errorScores = [0,0]selectedReduction = 5otherReduction = 1return = 0Every score is already zero.
Constraints
1 <= errorScores.length <= 10^5.0 <= errorScores[i] <= 10^9.0 <= otherReduction < selectedReduction <= 10^9.
More Wells Fargo Online Assessment questions
- Server Upgrade PlanningOA · Seen Nov 2026
- Student and Course EnrollmentOA · Seen Nov 2026
- Bond Interest Summary Above 3%OA · Seen Oct 2026
- Count Phrases Formed by Anagram ReplacementOA · Seen Oct 2026
- Event Statistics AggregatorOA · Seen Sep 2026
- Ordered Deployment Configuration ValidatorOA · Seen Sep 2026
- Longest Subsequence That Is a SubstringOA · Seen Jul 2026
- Overloaded Game Account InventoriesOA · Seen Jul 2026
- Count Server ReplacementsOA · PHONE SCREEN · Seen Feb 2026
- Minimum Remaining LengthOA · PHONE SCREEN · Seen Feb 2026
Similar questions at other companies
- Rock JumpingIMC Trading · OAIMC Trading interview questions
- Minimum Non-Adjacent Selection CapabilityMicrosoft · OAMicrosoft interview questions
- Minimum Rounds to Complete All TasksInfosys · OAInfosys interview questions
- Minimize Adjacent Squared-Difference Cost with One InsertionMcKinsey & Company · OAMcKinsey & Company interview questions
- Maximize Revenue from Decreasing InventoryChubb · OAChubb interview questions
- Minimum Values with Even Powers of TwoVisa · OAVisa interview questions
- Linear InterpolatorTwo Sigma · OATwo Sigma interview questions
- Minimum Halvings for Alternating ParityIBM · OAIBM interview questions
- Resource AllocationMaven Securities · OAMaven Securities interview questions
- Minimum Robot and Human Fulfillment TimeAmazon · OA