7 lines
No EOL
247 B
Python
7 lines
No EOL
247 B
Python
# 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] |