Problem
There is a cricket match going on between two teams and .
Team is batting second and got a target of runs. Currently, team has scored runs. Determine how many more runs Team should score to win the match.
Note: The target score in cricket matches is one more than the number of runs scored by the team that batted first.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of two space-separated integers and , the target for team and the current score of team respectively.
Output Format
For each test case, output how many more runs team should score to win the match.
Constraints
Sample 1:
4 200 50 100 99 130 97 53 51
150 1 33 2
Explanation:
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Test case : The target is runs and team has already made runs. Thus, the team needs to make runs more, to win the match.
Solution:-
- Swap adjacent characters
- Double the vowel characters
- Check valid parenthesis
- Print the characters with their frequencies
- Find closest value
- Word Count
- Program of CaesarCipher
- Program to find the perfect city
- Annual Day | Tech Mahindra coding question
- Find the number of pairs in the array whose sum is equal to a given target.
Wipro :-
- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID
Infytq :-
Key Points;-
Hackerrank:-
- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution
C-tutorial:-
- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array
See more:-
- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation
0 Comments