Cinema Seat Allocation

A cinema has n rows of 10 seats each, labeled 1 through 10. Some seats are already reserved. A group of 4 people needs four consecutive empty seats in a single row. Three possible group placements exist: seats [2,3,4,5], [4,5,6,7], or [6,7,8,9]. A single row can hold at most two non-overlapping groups. Find the maximum number of groups that can be seated.

Examples
Input: [3,[[1,2],[1,3],[1,8],[2,6],[3,1],[3,10]]]
Output: 4
Hints

Cinema Seat Allocation

A cinema has `n` rows of 10 seats each, labeled 1 through 10. Some seats are already reserved. A group of 4 people needs four consecutive empty seats in a single row. Three possible group placements exist: seats [2,3,4,5], [4,5,6,7], or [6,7,8,9]. A single row can hold at most two non-overlapping groups. Find the maximum number of groups that can be seated.