Aptean Interview Question

Cricket Rules code in java