Company: Mathworks_26oct
Difficulty: medium
Movie Theater Reservation Problem Description Implement a ticket service for a movie theater with n rows of seats, and m seats in each row. The service allocates seats among incoming booking requests. Implement the SeatReservation class with the following structure: Instance Variables: n : Integer representing the number of rows in the theater m : Integer representing the number of seats per row Constructor: SeatReservation(int n, int m) : Initializes the instance variables Methods: string reserve(int r, int k) : Attempts to reserve k adjacent seats in row r If seats are available, returns "Booked with seat number s" where s is the starting seat number If seats are not available, returns "Seats not available" Requests are handled in order, and once seats are booked, they cannot be booked again. The system must keep track of all reservations throughout the series of requests. Examples Example 1: With n = 2 , m = 3 , and the following requests: (1, 3) - Request for 3 seats in row 1 (2, 4