You are given a nums of length nums[i] denotes the cost of collecting a chocolate of type i.
You want to collect at least one chocolate of each type from
In one operation, you can pay a cost of x to rotate the chocolates circularly such that the chocolate originally of type i can now be collected at the cost of nums[(i + 1) % n]. You can perform this operation any number of times.
Return the minimum total cost needed to collect all
Constraints:
nums.length
nums[i]
x
You are given a nums of length nums[i] denotes the cost of collecting a chocolate of type i.
You want to collect at least one chocolate of each type from
In one operation, you can pay a cost of x to rotate the chocolates circularly such that the chocolate originally of type i can now be collected at the cost of nums[(i + 1) % n]. You can perform this operation any number of times.
Return the minimum total cost needed to collect all
Constraints:
nums.length
nums[i]
x