Given a classroom seating arrangement, place the maximum number of students so that no two students can cheat. Students cannot sit in broken seats, and they cannot sit adjacent horizontally or diagonally to another student in the row above. Pattern focus: Profile DP. Process the classroom row by row and represent each row by a bitmask of occupied seats.
seats = classroom seat grid
maximum number of students that can be seated
Example 1:
Input:
seats = [[".","."],[".","."]]
Output:
2
Explanation:
Place one student in each row in the same column to avoid conflicts.
Example 2:
Input:
seats = [[".","#","."],[".",".","."]]
Output:
4
Explanation:
One valid arrangement seats 2 students in the first row and 1 in the second row.
Example 3:
Input:
seats = [[".",".",".","."]]
Output:
2
Explanation:
In a single row, students must not sit next to each other.