Got this question along with balanced parentheses in the online assessment, any idea what problem is similar to this one below?
Development Team Threshold
A software company is currently made up of several teams with a certain number of employees in each team. A new policy is being implemented where the percentage Of senior developers in the teams needs to be at or above a certain threshold.
The company wants to hire new senior developers and place them into teams where needed so that this requirement is met for the company. Given the number Of employees and senior developers in each team, as well as the threshold percentage, how many senior developers does the company need to recruit?
For example, let's say that there is n 1 team, where teams [2, 5], and the threshold percentage requirement is r 60. The variable teams denote that there are 2 senior developers in a team that has a total size of 5. Initially, the percentage of senior developers in the team is 40% (2/5), but the following occurs as senior developers are hired and added to the team:
At this point, the threshold requirement of 60% has been met. Therefore, the answer is 3 because that is how many senior developers the company needs to hire in accordance with the new policy.
Note: The percentage does not apply to individual teams but rather an average Of all the teams. Each team has equal weight, so they must first be normalized to a common total score before calculating the percentage. For example, if senior developers make up 100% Of one team and 50% Of another, the total percentage is calculated as 75%.
Function Description
Complete the function hireSeniorDevs in the editor below. hireSeniorDevs has the following parameters:
int teams[n][2]: a 2-dimensional array of integers where ith the element contains two values, the first one denoting senior[i] and the second denoting total[i]
int r: the percentage of senior developers there needs to be in the teams
Returns:
int: the minimum number of senior developers the company needs to hire to meet the threshold r