Problem · Array
Maximize Efficiency with TikTok
Learn this problemProblem statement
Given an integer array efficiencyScores, select exactly five elements and return the largest possible product of the selected values.
The five elements must come from distinct array positions. Their original order does not matter.
The function maximizeEfficiencyProduct receives efficiencyScores, the efficiency scores of the available tasks, and returns the maximum product as a long.
Function
maximizeEfficiencyProduct(efficiencyScores: int[]) → longExamples
Example 1
efficiencyScores = [6, 1, 2, 8, 1]return = 96There are exactly five values, so all of them must be selected. Their product is 96.
Constraints
5 <= efficiencyScores.length <= 10^5-10^3 <= efficiencyScores[i] <= 10^3
More Tiktok problems
- Count Access Code PairsOA · Seen Jul 2026
- Count Key ChangesOA · Seen Jul 2026
- Travel Distance on ScootersOA · Seen Jul 2026
- Count Skipped Numbers After SubtractionsOA · Seen Jul 2026
- Obstacle Placement QueriesOA · Seen Jul 2026
- Repeated Grouped Digit SumOA · Seen Jul 2026
- Count Cyclic Digit PairsOA · Seen Jun 2026
- Event ID Check Completion TimesOA · Seen Jun 2026