Flaw in the Score Book
All submissions for this problem are available.
In a cricket match all bowlers were bowling too many extras. Extras being wide ball and no ball only. Due to this, the scorer got confused and
made some mistakes in the scorer book. You are given n strings which represent the deliveries in an over, in the scorer book. An over consists of exactly 6 balls and
extras in not counted as a legal ball. You have to print "YES" if the over is correct in the scorer book else print "NO"
First line contains single integer t denoting number of testcases.
The first line of each test case contains a single integer n denoting the number of deliveries in an over.
In the next line there are n space separated strings, each of which denote a ball bowled by the bowler.
where wd: Wide Ball
nb: No ball
For every testcase on a newline, print "YES" if the given over is valid else print "NO"
1 4 0 wd 3 2 0
1 4 0 wd wd 2 0
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6|
Fetching successful submissions