Practice Maximum Performance of a Team
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given two integers n and k and two integer arrays speed and efficiency both of length n. There are n engineers numbered from 1 to n. speed[i] and efficiency[i] represent the speed and efficiency of the ith engineer respectively. Choose at most k different engineers out of the n engineers to form a team with the maximum performance. The performance of a team is the sum of its engineers' speeds multiplied by the minimum efficiency among its engineers. Return the maximum performance of this team. Since the answer can be a huge number, return it modulo 10^9 + 7.
Source: Maximum Performance of a Team on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 2
60
# Example 2
n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 3
68
# Example 3
n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 4
72
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Performance of a Team.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.