First, calculate the lengths of consecutive groups of girls and boys, and store them in two arrays: girls and boys. Sort both arrays in non-increasing order. Then we begin the casework: If the largest ...