A chef has collected data on the satisfaction levels of n dishes, given in an integer array satisfaction.
The chef can cook any dish in time $ imes$ satisfaction[i].
Dishes can be prepared in any chosen order, and the chef is allowed to discard any number of dishes to maximize the total value.
Return the maximum sum of the like-time coefficient that the chef can achieve after preparing the dishes.
Constraints:
n satisfaction.length
n
satisfaction[i]
A chef has collected data on the satisfaction levels of n dishes, given in an integer array satisfaction.
The chef can cook any dish in time $ imes$ satisfaction[i].
Dishes can be prepared in any chosen order, and the chef is allowed to discard any number of dishes to maximize the total value.
Return the maximum sum of the like-time coefficient that the chef can achieve after preparing the dishes.
Constraints:
n satisfaction.length
n
satisfaction[i]