Question: Question Solution A software company has N different projects, each with a certain number of API files. Currently, it is production time, all the projects
Question
"Solution"
A software company has N different projects, each with a certain number of API files. Currently, it is production time, all the projects are to be updated on live production and this is to be done by executing API files for all the projects, As projects are interconnected, there is a condition to execute all the project's API files. Each project contains a number of API files and a blockage count B where the blockage count shows that if the current project is executed then the next upcoming B projects cannot be executed at that point in time. The production team wishes to know the maximum total number of API files that can be executed during the first execution while satisfying the given.condition.
Write an algorithm to find the maximum total number of API files that can be executed during the first execution while satisfying the given condition.
Input
The first line consists of two space separated integers projects row and project, col, representing the number of projects N and the number of details given for eachproject M where M is always The next N line consists of M space separated integers representing the number of API files in each project and the blockage count P
Output
Print an Integer representing the maximum total number of API files that can be executed during the first execution while satisfying the given condition.
Example
Input:
Output:
Explanation:
The maximum total API files can be executed by executing projects and
Execute project : API files are executed, and the next project cannot be executed, that is project
Unable to execute project Execute project : API files are executed, and the remaining projects cannot be executed as the remaining project is one and the blockage count for the current project is
Total API files executed: There is no other way to execute or more API files. Therefore, the output is import java.ioBufferedReader;
import java.ioInputStreamReader;
import java.util.Scanner;
class Solution
public static void mainString args
write your code here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
