Practice Reducing Dishes
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
A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time. Like-time coefficient of a dish is defined as the time taken to cook that dish including previous dishes multiplied by its satisfaction level i.e. time[i] * satisfaction[i]. Return the maximum sum of like-time coefficient that the chef can obtain after preparing some amount of dishes. Dishes can be prepared in any order and the chef can discard some dishes to get this maximum value.
Source: Reducing Dishes on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
satisfaction = [-1,-8,0,5,-9]
14
# Example 2
satisfaction = [4,3,2]
20
# Example 3
satisfaction = [-1,-4,-5]
0
Constraints
Related LeetCode Problems
Practice more problems similar to Reducing Dishes.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.