You are given an array of strings events representing a sequence of occurrences in a cricket match.
You need to track the total runs scored and the total wickets fallen. Starting with both runs and wickets equal to events sequentially according to the following rules:
"0", "1", "2", "3", "4", or "6": Add the corresponding numerical value to the total runs.
"WD": A wide delivery. Add
"NB": A no ball delivery. Add
"W": A wicket delivery. Add
If the wicket count reaches
Return an integer array in the format [total_runs, total_wickets].
Constraints:
events.length
events[i] is one of "0", "1", "2", "3", "4", "6", "W", "WD", or "NB".
You are given an array of strings events representing a sequence of occurrences in a cricket match.
You need to track the total runs scored and the total wickets fallen. Starting with both runs and wickets equal to events sequentially according to the following rules:
"0", "1", "2", "3", "4", or "6": Add the corresponding numerical value to the total runs.
"WD": A wide delivery. Add
"NB": A no ball delivery. Add
"W": A wicket delivery. Add
If the wicket count reaches
Return an integer array in the format [total_runs, total_wickets].
Constraints:
events.length
events[i] is one of "0", "1", "2", "3", "4", "6", "W", "WD", or "NB".