Given a sequence of ball numbers and scores, how do you determine the over boundaries when there are illegal deliveries that do not increment the ball count?
š” Model Answer
In cricket, an over consists of six legal deliveries. Illegal deliveries (wide, no-ball, etc.) do not count towards the ball count but still produce a ball number in the record. To determine over boundaries, iterate through the ball sequence while maintaining a counter for legal balls. Increment the counter only when the delivery is legal. When the counter reaches six, you have completed an over; reset the counter to zero and increment the over number. If you encounter an illegal delivery, skip the counter increment but still record the ball number. This logic ensures that the over boundaries are correctly identified even when the total number of recorded balls exceeds six due to illegal deliveries.
This answer was generated by AI for study purposes. Use it as a starting point ā personalize it with your own experience.
š¤ Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers ā invisible to screen sharing.
Get Assisting AI ā Starts at ā¹500