You are given an integer array nums.
In each operation, you remove elements from nums based on the following rules:
If nums.length is at least nums and remove them. The cost of this operation is the maximum of the
If nums.length is less than nums. The cost of this operation is the maximum of all the removed elements.
Return the minimum total cost to remove all elements from nums.
Constraints:
nums.length
nums[i]
You are given an integer array nums.
In each operation, you remove elements from nums based on the following rules:
If nums.length is at least nums and remove them. The cost of this operation is the maximum of the
If nums.length is less than nums. The cost of this operation is the maximum of all the removed elements.
Return the minimum total cost to remove all elements from nums.
Constraints:
nums.length
nums[i]