Bangladesh Premier League is in Sylhet for the first time. Today's match is Sylhet Sixers vs the Dhaka Dynamites. Dhaka Dynamites seems to have a good batting line-up. There are many people coming to Sylhet International Stadium to see this match and you are one of them.
Now you want to count how many balls there are in an over. Dhaka Dynamites is batting first and Nasir Hossain from Sylhet Sixers is bowling his first over.
Nasir bowled 9 times in his first over.
This gave you an idea: Why not write a program that can determine the number of legal balls based on the outcomes of each ball and hence the number of overs played.
Given a series of outcomes of balls bowled by a bowler, you have to determine the number of legal balls and the number of overs that have been played. The following are the possible outcomes of each ball:
As always, no ball, wide ball, and dead balls are not to be counted.
The input starts with an integer () denoting the number of test cases. Each case starts with a line containing a string () representing the outcomes of each ball. It is guaranteed that there is at least one legal ball.
For each test case print, the number of legal balls and overs played. Make sure you are using the correct pluralization ( vs , and vs ).
3 W123NW6WD64 444WO213 444
1 OVER 1 OVER 1 BALL 3 BALLS
Login to submit
|IUB Beginners' Contest 2020|
|Intra Sylhet Polytechnic Institute Winter Programming Contest 2017|
|Tough Dash, April 2019|
|4th Just Intra University Contest|
|Shuvo Noboborso (1427) Programming contest ( Open for All )|
|SUB Beginners' Contest|
|4th Just Intra University Contest 2nd|
|AUST CSE 44th Batch Practise Contest 04|
|BRACU Quarantine Contest for First Year Students|