Opening your workspace…
Workspace/Coding room
Opening your workspace…
You're batting against Matt in Wii Sports Baseball. Every pitch is called a ball or a strike. How many strikes does Matt get past you before you strike out, walk, or the recording ends?
["strike","ball","strike","strike","ball"]Output3The third strike ends the at-bat, so the last ball does not count.
["ball","strike","ball","strike"]Output2Only two strikes appear before the pitches run out.
Count balls as well as strikes so a walk ends the at-bat.
function solve(pitches) { // Write your solution here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.