Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Candy Shop Jack loves candies and he goes to the market to buy some. There are K different flavours of candies available in the
Candy Shop Jack loves candies and he goes to the market to buy some. There are K different flavours of candies available in the market and he wants to buy candies of all flavours. Also, there are N types of candy combos available in the market. Each candy combo having some cost C contains candies of one or more flavours. Help Jack to buy candy combos in such a way that he will have all the flavours at the end and will have to incur the minimum cost in doing so. You are given- 1. An integer array Cost[] having the cost of all the candy combos available in the market. 2. An integer K denoting the number of different candy flavours available in the market. 3. An integer N denoting the different types of candy combos available in the market. 4. An array of N binary strings denoting the availability of various candy flavours in a candy combo. In each string, denoting a single combo, if the ith character is 1 that means it contains the ith flavour of candy otherwise not. Your task is to return the minimum cost required for buying combos such that Jack will have all the flavours of candies in the end. Il tasts metti.com is sharin
Step by Step Solution
★★★★★
3.48 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
Answer Heres a Python function that should help you find the minimum cost def mincosttogetallflavour...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started