Company: Deutsche bank_7aug
Difficulty: medium
Minimum price Problem Description N stones are lying in a line. The cost and type of the i-th stone is a_i unit(s) and i respectively. You are initially having zero stones and you wish to collect all N types of stones. Type 1, type 2, ..., type N. You can perform the following operation multiple times (probably zero) to change the types of all the stones in one step: The stone of the type i will change to the type i+1. If i is N, then change its type to 1. (1 <= i <= N) Applying this operation single-time costs x unit(s). Print the minimum price that you have to pay to get all the N types of stones in your collection. Function Description Complete the min_price_sol function. This function takes the following 3 parameters and returns the minimum price that you have to pay to get all the N types of stones in your collection. Parameters: N : Represents the number of stones X : Represents the cost of one operation a : Represents an array of sizes N represents the cost of each stone I