0813. Largest Sum of Averages
Description
**Input:** nums = [9,1,2,3,9], k = 3
**Output:** 20.00000
**Explanation:**
The best choice is to partition nums into [9], [1, 2, 3], [9]. The answer is 9 + (1 + 2 + 3) / 3 + 9 = 20.
We could have also partitioned nums into [9, 1], [2], [3, 9], for example.
That partition would lead to a score of 5 + 2 + 6 = 13, which is worse.**Input:** nums = [1,2,3,4,5,6,7], k = 4
**Output:** 20.50000ac
Last updated