This commit is contained in:
parent
1609c46b28
commit
308dfbad7e
1 changed files with 7 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
||||||
|
# https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i
|
||||||
|
|
||||||
|
class Solution:
|
||||||
|
def minimumCost(self, nums: List[int]) -> int:
|
||||||
|
first = nums[0]
|
||||||
|
rest = sorted(nums[1:])
|
||||||
|
return first + rest[0] + rest[1]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue