Untitled
user_9132356
python
3 years ago
221 B
9
Indexable
def maxScore(popularity):
N = len(popularity)
popularity.sort()
def cook(i=0, j=1):
if i == N:
return 0
return max(cook(i+1, j+1)+popularity[i]*j, cook(i+1, j))
return cook()Editor is loading...