Question 1: Women in Tech
Problem Statement:
An aspiring programmer is preparing for a coding competition and encounters a problem: finding the minimum number of operations required to make all integers in an array equal.
In a single operation, any bit of any element can be flipped.
Determine the minimum number of bit flip operations required to make all array elements equal.
Example:
n = 2
arr = [1, 2]
Optimal Operations:
Function Description:
Complete the function getMinOperations in the editor with the following parameter:
Problem Statement:
Given n machine learning models, each with an associated cost and feature compatibility:
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.
Example:
n = 6
cost = [3, 6, 9, 1, 2, 5]
featureAvailability = ["10", "01", "11", "01", "11", "10"]