1386. Cinema Seat Allocation
1386. Cinema Seat Allocation A cinema has n rows of seats, numbered from 1 to n and there are ten seats in each row, labelled from 1 to 10 as shown in the figure above. Given the array reservedSeats containing the numbers of seats already reserved, for example, reservedSeats[i]=[3,8] means the seat located in row 3 and labelled with 8 is already reserved. Return the maximum number of four-person families you can allocate on the cinema seats. A four-person family occupies fours seats in one row , that are next to each other . Seats across an aisle (such as [3,3] and [3,4]) are not considered to be next to each other, however, It is permissible for the four-person family to be separated by an aisle, but in that case, exactly two people have to sit on each side of the aisle. Example 1: Input: n = 3, reservedSeats = [[1,2],[1,3]...
Comments
Post a Comment