Question: You are given an integer N , representing the number of matches, an integer M representing the maximum winning margin, an integer R , representing

You are given an integer N, representing the number of matches, an integer M representing the maximum winning margin, an integer R, representing the redaired run rate for qualification and an integer array W, representing the winning margins of previous matches (N-1) played by the team. Your task is to find and retum an integer value representing the minimum number of
runs by which a team should win the last match to qualify for the playoffs. Return -1 if qualification is not possible.
Qualifying Chances
Input Specification:
input1: An integer value N, representing the number of matches a team can play
in the tournament. input2: An integer value M, representing the maximum margin by which a team
can win in the tournament.
input3: An integer value R, representing the required run rate which the team must have at the end of the league stages to qualify for the playoffs.
Input4: An integer array W, representing the winning margin of all the matches a team has played till now in the tournament.
Output Specification:
Return an integer value representing the minimum number of runs by which a team should win the last match to qualify for the playoffs. Return -1 if qualification is not possible.
ables
Example 1:
001

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!