Question: Question 2 [20 marks] A hotel needs your help. Write a program called hotel_061.py that reads a single line of numbers from stdin. The first
![Question 2 [20 marks] A hotel needs your help. Write a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2e4fb5b756_36266f2e4fad0f10.jpg)
Question 2 [20 marks] A hotel needs your help. Write a program called hotel_061.py that reads a single line of numbers from stdin. The first number in each line is, N, the number of rooms in the hotel. Rooms are numbered 1 to N. N is in the range 1-1000. Following N is a list of the rooms that are occupied. Occupied room numbers are listed in random order and in the range 1-N. Each occupied room number appears no more than once in the list. It is possible that no rooms are occupied. Write a program that reads the above input and outputs the lowest numbered available room or no room if none are available. In this example there are 5 rooms in the hotel, rooms 4, 2, 1 are occupied. So the lowest numbered available room is 3: $ cat hotel_stdin_00_061.txt 5 4 2 1 $ python3 hotel_061.py
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
