Posts

Showing posts from March 19, 2021

Multi-Storey Car Parking Lot

 Multi-Storey Car Parking Lot PROBLEM STATEMENT :  The program must accept an integer matrix of size R*C representing a multi-storey car parking lot. The integer 0 represents an empty slot and the integer 1 represents a car. The entry point is always present at the bottom-right of the ground floor. The way to reach the 1st floor is on the left side of the ground floor. The way to reach the 2nd floor is on the right side of the 1st floor. Similarly, the ways to the remaining floors are present on the left side and right side alternatively. A person wants to park his car in the first occurring empty slot on or above the Xth floor. The value of X is also passed as the input. The program must print the instructions he needs to follow to park his car as the output. The instructions must be in the following formats. -> L followed by an integer K - It indicates that he needs to move K slots towards left.  -> R followed by an integer K - It indicates that he needs to move ...