Count Boundaries in Cricket Innings
Count Boundaries in Cricket Innings
EasyStrings12% accepted
Arjun analyzes his favorite cricket match and wants to count the total number of boundaries (fours and sixes) hit during an innings. He has a record of runs scored on each ball.
Approach
Given a comma-separated string of runs scored in each ball, count the total number of boundaries (4s and 6s).
Input
4,1,2,0,6,0,4,2
Output
3
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards