Question: Some avengers might have a seating preference for window ( ' W ' ) , middle ( ' M ' ) , or aisle (

Some avengers might have a seating preference for window ('W'), middle ('M'), or aisle ('A') seats.
A) Can Sit by Preference?
Implement an algorithm to determine if it is possible to seat certain avengers according to their preference.
preference be one of the characters ->'W','M', or 'A'
If they can be seated, print 'Yes, you may board!'; if not, print 'Boarding Denied!'
Note:
Middle seat can only exist in Economy class. A seat surrounded by two seats on each side, is a middle seat. For example OMO|OMMO|OMO; middle seat is represented by M.
Aisle seat is a seat that is adjacent to an aisle (|). In First class, a window seat can also be an aisle seat at the same time. For example, O|OO|O; seats in bold letters are aisle and window seats at the same time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!