generate a linked list, each node indicate a room. At the very beginning, the list includes all the rooms. Whenever a room is cleaned, it will be removed from the list. What you need to do is just print this list.