Floor Cleaner
Time limit1sMemory limit1024 MB
Given a 10 by 10 floor grid and a list of obstruction coordinates, print the locations the robot could not clean, sorted by row then column.
- Level
Easy2 of 10
- Topics
- Implementation, Sorting
- Solved
- No attempts yet
Problem
You have built a floor cleaning robot and now you are writing an algorithm that reports every location in the house the robot could not clean. The robot is given a layout of the house that shows where the walls, furniture, and flooring are. While cleaning, the robot logs each location where it finds an unexpected obstruction. The key is:
- 'W': Wall
- 'F': Furniture
- '-': Flooring
- 'B': Base
Input
The input starts with a 10 by 10 grid that describes the house, with columns and rows numbered 0 to 9. The grid is followed by an unknown number of locations where obstructions were found, in the following format:
(column,row)
Output
Print every location that the robot could not clean, in the following format:
(column,row)
Print each location on its own line. Sort the locations in ascending order by row first, then by column.