← 返回 snapchat 的题目列表药物安排问题
类型:online_judge
You have a set of drugs that need to be classified and grouped according to certain rules to achieve the maximum benefit. Implement the function maxDrugBenefit that takes an integer array drugs representing the effectiveness of the drugs and returns the maximum benefit possible under the given rules.
Input:
drugs (List[int]): An integer array containing the effectiveness of the drugs.
Output:
Return the maximum benefit possible.
Example:
Input: drugs = [3, 8, 1, 5]
Output: 16
Constraints:
1 <= len(drugs) <= 1000
1 <= drugs[i] <= 100
Note:
Assume all drugs can be chosen from, and the effectiveness of any drug lies within the given range.
Example
Input
3 8 1 5