I am not able to understand the question . Please explain the conditions like we need to buy 1kg of each fruit or just buy any fruit , do we need to buy from each shop etc.
Question not clear Buying Fruits
Hello @Vishal_234,
- whatever you would purchase from a shop will be of 1 kg.
- You can buy any fruit but one type of fruit from a single shop.
- You cannot buy some fruit from the adjacent shop.
- You have to buy from all n shops.
- the cost should come out to be minimum.
Example
Input:
1
3
1 50 50
50 50 50
1 50 50
Output:
52
Explanation:
There are two ways, each one gives 52 as minimum cost. One way is buy brinjals from first shop, carrots from second shop and brinjals from third shop or he can buy brinjals from first shop, tomatoes from second shop and brinjals from third shop.
Both ways , cost comes up to 1 + 50 + 1 = 52
Hope, this would help.
Give a like if you are satisfied.
1 Like