This page is still under construction.

Parts of this page are still being built. What you see may change.

Floor Cleaner

Time limit1sMemory limit1024 MB

Summary
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.

Examples1

  1. Example 1

    Input
    WWWWWWWWWW
    W-------BW
    WF--FW---W
    W---FW--FW
    WWWWW---FW
    W--WW---WW
    W-FW----FW
    W-WWWF---W
    W--------W
    WWWWWWWWWW
    (2,1)
    (1,8)
    
    Expected output
    (1,1)
    (2,1)
    (1,5)
    (2,5)
    (1,6)
    (1,7)
    (1,8)