Approach
The answer is find the two minimum from index 1, and add the first one. We sort the nums after index 1, and add the first three.
Code
class Solution {
public:
int minimumCost(vector<int>& nums) {
sort(nums.begin()+1, nums.end());
return nums[0] + nums[1] + nums[2];
}
};