Problem Brief
Least Hours to Implement Features
OA
See Salesforce online assessment and hiring insights
There are two lists of size n - developmentTime and integrationTime. Any feature can be either implemented by development or by integration. While development of multiple features can happen concurrently by multiple developers, integration of features can only be sequential and can only be done by the team lead. Return the least number of hours to implement all the n features. Assume, there are more than n developers.
Function Description
Complete the function leastHours in the editor.
leastHours has the following parameters:
- 1.
int[] developmentTime: an array of integers representing the time to develop each feature - 2.
int[] integrationTime: an array of integers representing the time to integrate each feature
Returns
int: the least number of hours to implement all features
1Example 1
Input
developmentTime = [3, 4, 5, 9], integrationTime = [3, 2, 5, 5]
Output
5
Explanation
First 3 features are developed and take 5 hours and in the meanwhile, integration of the last one takes place.
2Example 2
Input
developmentTime = [8, 10, 6, 7], integrationTime = [1, 2, 2, 1]
Output
6
Explanation
Sum of all integrations (1 + 2 + 2 + 1 = 6) is less than the minimum development time, so all features are integrated.