Company: Microsoft_data_scientist_role
Difficulty: medium
Get Minimum Cost Problem Description Given n machine learning models, each with an associated cost and feature compatibility: cost[i] represents the cost of the i th model. featureAvailability[i] is a binary string indicating suitability for two distinct features: "00" : not equipped for either feature. "01" : suitable for feature A but not feature B. "10" : suitable for feature B but not feature A. "11" : suitable for both features. A set of models is k-capable if the number of models suitable for feature A and the number suitable for feature B are both greater than or equal to k . For each value of k from 1 to n , determine the minimum cost required to assemble a k-capable set of models. Return an array of n integers, where the i th integer represents the minimum cost for an i -capable set. If no i -capable set exists, the i th integer should be -1. Examples Example 1: Input: cost = [3, 6, 9, 1, 2, 5], featureAvailability = ["10", "01", "11", "01", "11", "10"] Output: [2, 6, 15, 26,