Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions