Problem Statement
Tim and Tom are playing a game called Super-Doorknobs. From a starting position inside Tim's house, they each have to try to be the first one to touch a given number of doorknobs in any order. Tom, being aware of his disadvantage of not knowing Tim's house, decides to code up a quick algorithm to tell him which doorknobs to go after.
Given the configuration of the house and the number of doorknobs they need to hit, return the length of the shortest path that includes touching the necessary number of doorknobs.
The house configuration will be a
'.' - empty square.
'o' - square with a doorknob (they touch the doorknob the moment they enter this square).
'#' - a wall that neither of them can run through.
For example, if Tim and Tom were racing to touch 3 doorknobs in the following house configuration (quotes added for clarity):
{".....", "o....", "o....", "o....", "...o."}
The shortest path is straight down, and has a total length of 3. Therefore the method would return 3.
Definition
- Class:
- Doorknobs
- Method:
- shortest
- Parameters:
- String[], int
- Returns:
- int
- Method signature:
- int shortest(String[] house, int doorknobs)
- (be sure your method is public)
Notes
- If there is no way to reach <doorknobs> doorknobs from the starting location at the top-left of the house, return -1.
- Tim and Tom can only move up, down, left, or right. Diagonals are not allowed.
Constraints
- house will contain between 5 and 50 elements, inclusive.
- each element of house will be of length 5 to 50, inclusive.
- each element of house will be the same length as every other element of house.
- each element of house will contain only the characters '.', '#', and/or 'o'.
- the first character of the first element of house (the top-left square) will be a '.'.
- doorknobs will be between 1 and 4, inclusive.
- the number of 'o' characters in house is between
and 6, inclusive.
Examples
{"....." ,"o...." ,"o...." ,"o...." ,"...o."}
3
Returns: 3
{"....." ,"o...." ,"o...." ,"o...." ,"...o."}
4
Returns: 7
{".#..." ,"#...." ,"...oo" ,"...oo" ,"...oo"}
1
Returns: -1
Tim and Tom can't move from the starting location (what an odd house).
{"...o." ,"o..o." ,"....." ,"..oo." ,"....."}
4
Returns: 7
{"....#" ,".##o#" ,".##oo" ,"o##.#" ,"....#"}
4
Returns: 12
{"....#" ,"o##o#" ,".##oo" ,".##.#" ,"....#"}
4
Returns: 8
{".#...#...#...#...#...#...#...#...#...#...#...#...#",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",".#.#.#.#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.#..",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.##.",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.##.",".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#oo","...#...#...#...#...#...#...#...#...#...#...#...#oo"}
4
Returns: 1298
{".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,"...................o.............................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,"........................................o........." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,"..........o......................................." ,".................................................." ,".................................................." ,".................................................." ,".....................................o............" ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................."}
4
Returns: 106
{"..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","...................o..............................","..................................................","..................................................","..................................................","........................................#.........",".......................................#o#........","........................................#.........","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..........#.......................................",".........#o#......................................","..........#.......................................","..................................................",".....................................#............","....................................#o#...........",".....................................#............","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................","..................................................",".......................o.........................o"}
4
Returns: -1
{".#.#.......#.#......................#..#..#.....",".#..#......##.............#.###......#..#..#..#.","#.......#...#...#....#..#.##...###....##.#......","....#....#.#......#..#....#..#......#....#......",".......#..#.#.#...............#..#...#..###....#","#...##.#...##...##.........#.......#........#...","........................#.##...#....##.........#","...##................##....#........#....##..#..","#...#.....#...............#....##.....#......#..","...#......#.#......#...#........##.#.....#......","#..#..#..#....###..........#..#...#..#....#.....","......#...#........#....#......#..#...#....##.#.","............#...#.....#...#...#........##....#..","....#...#.#.........#.#......#............#.....",".#.#....#....#.....#............#........#.#....","....#...#...##..........#.#..#..................",".#.....#.##.......#....#.......##.....#.....#...",".......#............#.............##....#.##.#..",".#..#........####.#..#.............##...o.#.##..",".##..........#..#..#....#..#..o....#........#...","......o..#......##..#.......#.....##.....#......"}
3
Returns: -1
{".#....#......#...#.....#..#...##.....#..#","....##..#.....##.##.....##...#.#....#..##","#.......#..#....#....#..##.....#.........","...#..............#...o......##..##......",".....#..............#.........#.#.....#..","........#...............................#",".............#..##.....####....#......#..","....#.....#......#.........#.............",".......#.....#.#.................#......#","#.............#...##...........#....#...#","....#.#..#......#.......#..##............","#......#.....#...#.....#.#......###..#...","###..........o#..##....##......#..##.....","..............#......o..............#.#..","..###....................##.#.....#..#.#.","...#....#......#........#...###.........#","#....#.#...#.#.#..o..#.......#...........","...###..#.......#..............#....#....","#...#......#...........#.#......#.....#..","......#.##............#.....#.......#....","#..#....#...##.#......#.....##...#.......","...#...#.#..............##..###...#....#.",".#...##.....#.....###...#.#......#...#...","...........#.......#.#....#.....#....#.#.","#.......#.........#.#.#..#...#..#.#..#...","..............#.#.#.#..#.#......#........","#.......##...#..........##.....#...#.....","..#.....##....#..###..............#......",".....#...#......#...o........#.#.....##..","#......#.##...#...#.............#........","............#.....#......##...#.#......#.","..#..#..........................#.....#..","##.....##.#..#................#..#.....#.",".......#....#............#.#........#....","........#....##....#.......#.....#....#..","##.#....#....#.....#...#...#..#.....#....",".........#..#........#.#..#........#.#...","#..#.....#..#......#..#..............#...","...#...#...##....##..#.#.##.....#..#.##.."}
4
Returns: 51
{"...................#..#.....#.",".#...........###.#..#.......##","..#...#.#..#.........o#..##...","........#...#....#..........#.","......#....#.........##.#..#..",".....#..#..#.......##.#....o..","..#........###.........#.#.#..","........#.#..#.....#......#...",".#.....#..##.....#......#....#","...#..#......#.#..#...........",".#...#.#...#....#...........#.","....###....#....#.........#...","##...............#...#....#..#","....#.#....#.#....#....#......","....#.............#.........#.","#.####....#.#........##....##.","...#......#..........#......##","#....#.........#........##..#.","#......##..#...##....###.....#","...##....#........#...........",".#..........##.........##.....",".................#....#.#.#..#","......#....#..#.o##...#.....##",".....###..#..#..#......#....##","..#..........................#",".##....#..............#.....#.",".......................#....#.","#.......#...#.....#.........##","..#..#..#......#...#..#.#....#","..#...##....##...##.##.##..##.","......#..o....#.........##...#","...#...##.....................",".....#..#.......#.....#....#.."}
4
Returns: 75
{"...o........#...#......#.#......................#",".#..#.....#.#..#..#.#.#..............#....#.#....",".....#..#......#................................#",".#...#..#......#.......#......#............#.....","............#........#..#.....#.#...##.#.....#.#.",".....##.#....#..........#.......##......#........","......##...#.......#.##....#.#.#....#............","##..#...............##..#..#.#.........#....#..#.",".....#.............#.........#.........#.......#.",".......#.....#......###..#..............#..##....",".#...##.......#..#..#.............#.##..o..#.#...","....#.............#.....#......#..............#..","#.......#.............#.o##.#..#.#.#............#","............##..##..#.#..#.....#.....#....#.....#",".#....#...............#..........#...#.##.#......",".....#.#..#..#......#..#..#.....#........#...#...","..#.......#..#..#............##...#.........#....",".....#..#.......#..........##.....#....#.........","..........#.....#.#.o.......##.........###.......","..#......#........##.....#..###......###.#.....##","......#..#.#..............#....##...#..#.....#..."}
2
Returns: 36
{".......",".......","...###.",".......","..##...",".......","..o#..#",".......","#......",".......",".......","#..o...","...#...",".......",".#o...#","...#.#.",".......","....o.#","..#..#.","##.....",".......","#...#..",".......",".##....","#...o#.","..#.#..","...#...",".##....","..#..o."}
3
Returns: 18
{".#.............#....","..#....#............","#.......##.#......#.",".##.......#.......#.","..#.o##..#.#........",".....#...#..#....#.#",".........#...#......",".#.................#",".#.#........#.#....#","......##........#...",".........####.......",".#.......#....#....."}
1
Returns: 8
{".........#.........#",".#......#....###....",".......#..........#.","..........#.........","#........#..........",".....#..#...#.##....",".#..................","#.....#...o........#","#..#.....#..#.#...#.","...#........#.##...#"}
1
Returns: 17
{".#.....#...#..###.##..#.......#.###.#","...###........###....#.#.............","#..#.#.........#........#..........##",".#.#......##........#.#.#.#..#....#..","#..##o#..#..........#...###.....##...",".###....#....#.###.#.##...#.......##.","................o........##.#.....#..",".#..#..#..#.#...#.#.....#..#....#..#.",".....##.#..#.#.......#....#...#.###..","...#........#...#.......#...#.....#..","#..............#..........#...#..#.##","......##..........#....#..##...#...##",".......#..#......#....#..#....#......","#.....#..##............#...#....#....",".#...o..................#...##.......","....#....#..#.............#......#...",".#..#.....#..#....#..#..............#","........#..#.#....#..#..#.......#.#..",".......#.#..##.......##........##....","..#...#.#...#.......#...#..#....#....","..#.#.#..#.#.##..#.#.....#...#.....#.","#.#.....o....#....#.#....#.....#...#.","....#.#...........###.#.#..#....#....",".........#...........###....#....#.#."}
2
Returns: 26
{".#..###............#.#.#...#........","..#......#....###........#..#...#...","#...#........#............#.........",".....#.##....o...#..........#...#.#.","...#.........#......#.......##.##...","....#.......#.#.#...#..#............",".#........o.........#..#.###.#...#..","..#.#...#...#....#.##.........#..##.","...........#...#.........#.....#..##","#.##....#....#.......#.....#.#.#..#.","...#.....o..............###.......#.","...#...#.......#..............#.#...","..#....#..#.#...##...#..#......#..#.",".....#.#.....#..#...#.#....#.#..##..","..............#...........##......#.",".........#...#......#.###.#..#.#...#","#.#..#...#....#.........#....#......","#..........#o...#...#.###...#...#...","....#..#...............#........#.#.","#.##.....#..#...........#.......#...",".#.......#.......#...###.....#......",".....#....#.........##......#o......","#.....##....#..###..##..##......#...","..#...#...#...........#.........#..#","...#.....#........#.#....#....#.....","....##.........#.....##........#.###","...#......##.#.#........#...#......#","##..#..........#.....#......#..#.#.#",".........#.#..#.#.#....##...##......",".......#...#..#...#......#..........",".................###....#...........",".....##.....##.#..##.#............#.","...#...#.....#...........#...#...#.#",".......#.#......#...#..#..#...#.....","...#....#.#......##.#.....#.#.#....."}
4
Returns: 39
{"...#.........##....#.....","....#.....#..............","#.......####.......#.##..",".##.......#.#....#..#.#..","........#..#...#.##..o...",".........................","##....#...##..#...#......",".#........#........#..##.","##..#.#............#..#..",".#.o.###...##.......#....","#.........#...#...#.##..#","....##....#.##..#....#.##",".#.....#.#..#..#.#..#....","...........#.....#.......",".#..#........##.....#....",".....#......o..........#.","..#...#.#.#.#.#..#.##..#.","#........#.....#...#...#.",".#..............#.......#","..#..##.......#.........#","##..#..#......#......#...","......#...........#.#.#..","....###.....#...#.....#..",".......##.o....#..#....#.",".#..##.......##.#........",".#.##.....#...#..........",".....#..#.#.....##......#","...#.........##....#..##.","......#......#...###.....","#.#.....#..#.##.#..####.#","......o.#.##..#........##","#..#..........##...#.#...","....#.#.......#..........","..........#.......#......","#.##......#...#..#....###","#..#......#..#...........",".#...#..#..........##.#..","..#...##..........#...#..",".........#...............",".....#.#......#.#........","...#...#..o.............."}
3
Returns: 37
{"........###.###...#...#...#....##.....#..#.","..................o..#.##............#.....","...###...#.#....#....#.......#.....#.#.....","..#...............#..#.....#..#..#..#....#.",".....#..#....#...........#.....#..##......#","......#....###.............#........##.#...","#..#...........#.##.#..........#......#..#.","..##.....#..#......#....#........#.......#.","#...###...##..#.....##...........#.......##","....#..##....#..#...#....#..#...#....##....","..#.....................#.##...........#...","#..##..#.#..#.#...#..#.......##...#.....###","..#........#.#..#....#...#..#..........####","........###...#............................","..#..#.#...............#....#.##.......#.#.","#...............##...#............#.#......",".......##....#.........#..#...#............","#..#...#...#.......#.#...#..............#..","......#...#...#..........###..#............",".#......#...##.......#.#..........#........","...##.###.#.#..#...#....#.........#.......#","...#......#...#.#...#......#...............","....#............#...#.....#......#........","#.#.##..##..#.......##........#.#.#........","..........####.......#.....#...#.o...o#.#..","##....#.............o.#......#.#..........#",".#..##...##.#...#...##........#........##.#",".....#........#..#...........#..........#..","......###.#..#.##....##..##..##............","...........#.#.##.#....#.....#.....#.#..###","..#.....##.#.#........#....##.##........#.#","..#.............#...#.#...#..........##...#","...#.#..#.....#.....#.....#..#..#..#.......","...#...........###..#..#................#.#",".....#........#....#..#####.....##.......o.","......#.#..#......#...#...##.........#.#..#","...#.####..##.............##....#..#.#.....","#......#.#..#...##...#.......##...#...#....",".......#.#........#...............#..#...#.","...#...#..#...#.....#..................#.#."}
4
Returns: 75
{"..##.##......##....#.....#.##.#.","......#..#...#....#...#.....#...",".....o............#......o...#..","....#......#...#.#.#...#.##.#...",".....#...#......#......#.....#..","...#.....#....#..#...#.#..#..#..","o.........#...........#.#.#.#..#",".##..#..............o...#.......",".......##........#...#.#.#...#..","........#....o..#o.#.........#.."}
4
Returns: 36
{"...#.#...#.#......#....#...#.............",".........#..#.......##...............#...",".....#.#......#.......#.o##...........##.","##..#..#..#....#.#.....#.#.#.#..#.#.#..#.",".#.#.............#..............#.....#..","....#.#...#......#.......................",".#...#.#.......#......#...#...#.....#.##.",".#...##........#.............#.#.....#.##","..#...#.....##........#...#.....#..#.....","..........#...##....#..#....#.#..........","#......##...##.....#........#.#..........","......##..........#..#.#.##....#.........","...#......##.#.............##......#.#.#.","#......##........#..##..###...#.#...##..#","...#..#..#..#.#.............#.....#......","#.............#...#......#....#.#........","...#.#......#.#.......o..#.#.....#.#.....","..#.#.#....#.....#.#......#...##.#.....#.",".......#...#.....#...##..#...............","#.#...##..o....##.#...##...#....#........","....#....#............................#.."}
3
Returns: 60
{"..#.#.....o....#...................#.#.","#.#.#.#.....##.......#.#........#.....#","....#..o.###.##..#.....#..#..#..###..##","....#.#........###.#.#........#....#...",".#..........##.....................#...","#......#...#......##.........#....#.#..","#....#......#...#...##.......#.#.......",".#.##..##...#..#........#.....#........","..#...#...#...#.#.#....#.###...#..#.#..",".......#...####......#...#.........#.#.","..#..........#.#..#.#.##..##.#........#","......#........#..#.##......#..#..#...#",".....##.......#..###.##............#...","...#.#....#.#....#........#..#..##.....","...#..............#.#........##........","##...###.....#............##.#..##.....",".#..####...........#.#..#.##......#....",".#..#..#............##........#.#..##.#",".#..#.............#..........o...#..#..","..#.#.#.....#.#...#....#......#..#....#","##....#............#.....#..##.........","...#....##.........##...#.......o#....#","........#.......#.....#...#.....##.....","..........#.#...........##..#.#........",".....#.#...#..##...#............#....#.","........#......#.....#.................","#........#.##............##............","..#........#.......#.......#....#......","#.......#......##...#..#.#..#.........#","#...#....#.#........#....#.........#...","...........##.....#.#....#.##.##.#...#.","#......##..##...............##....#....",".#.##.....#........#......###.....#.#.#","..#.##.......##..#.......#........#.#..","..........#.....#.......##.#.#..#......","####..........#....#...#...#..........#","...#..###..#..........#...###...#......",".....#...........#..##...##o....#......",".........#...........#.##..#.......#.#.","...#...#.....#.#.#.......#......#......","#......##..##.#....#...................","...#.....#...#...#..#..#..............#",".#.#..........##...............#...##.#","............#..#.....####..#.....#..#.#","....#....#.......#.#..#..#............#"}
4
Returns: 61
{".#....",".#..#.","#....#",".....#","#...#.","#.....","......","...#..","......","......","..#..#","......","o...#.","......","..#...","#.#...","......","#.....","..#...",".#....",".o.#..","#...#.",".....#","...#.#","..#...","##..#.","..#...","o.....","......",".....#","......","......","#.#.#.","#..#o.","o.....","#.....","#..#..","......","......"}
1
Returns: -1
{"....#",".#..#","...#.",".....","..##.","..#..",".....","..o..","....#","###..",".....",".....","##..#","..#..",".##o.",".....",".....",".....","#.#.#",".....","..#..",".#...",".#..#","..#..","#.#..","...#.","#.##.","#..#.",".o.o.","....#",".....",".....","#....",".....","#.#.."}
3
Returns: 33
{"........o......#.#.........","....#.#....#.#....#.##.#...",".....o....................#","....#...........#.....#....",".#.#....o.o..#.#....#......"}
4
Returns: 18
{".........#...........#....o.#..#o.#.","#......#......#.#............##.....","..#.#..#....#......##.#......#.##...","...#.#......###...##.#.....#........","..#...#.#....o...##.....o...#.o..#.."}
4
Returns: 48
{"..o...#.",".##..#..",".#....##","..o...#.",".......o",".#...#o#","#..#....","##......","#.......",".....#..","....#...","........",".#......","...#....","oo.....#","..#.....","....#..."}
4
Returns: 15
{".##...#.......#..o.........#...##...#.#.#.#.","#..##.....#..#.#.#..#.......##.#....##...#..",".#..##.........#....#..#....#.#...........#.","#..#..#..........#..........#..#..#..#..#...","............#.#.##.##..#.##...#.....#..#....",".....##..#.#.#..#........#..................","..#........#....##....#............#......#.","#.....#.....#........#.#......##......##....","..##.#....########..#.##..o#..#.#.....##....","...#...#........#....................#.....#","#......#.##.......................#.#.#.#..#",".............#.#..#.....#..o..............##",".......###.......###.#...#..#........#..##.#","...#.#.#.......#..o.#....#.......#........#.",".....#..#....#.#....o#...........#.....#.#.#",".#...#..#.#......##................#........",".#...#.#.##....##.......#..##....#...##..#.#","####.#........................#....#..#..#..",".......##.#......##....#.#.......##.........","....#................#.......#..............","##................#...##.#......##....#..#.#",".........##...#....#.#.#.#..#...........#.#.","..#.......#.#..#...###.#..#.....#.#...#.....","..#.................................#....#..","o.......#......#.#.#...#...##........#......","...#..............#.....#..#......#.........",".#....#.#.#.......#.......###.#.....#.......","....#......#...#.#.#.#...............#...#.."}
2
Returns: -1
{".#.......#...#...#........#.","..#........o#..#....###.....",".......###.#...#.##.........",".....#.............#...#....",".....##.....#............#..","....##....#.o..#...#........","...##..#....#.##..##........","..#....###.#..#.....#.#..#.#",".........#......#........#..","..#..o....#.........#.##....",".#..##...##............#..#.","..#...#....#.#.##......#..#.","...#..#.#....#......#.##....","#........#......###.#.....#.","...........##..#......#.#...","#...#...#..........#..##....",".#.#.#.#....##..............","..##........#...#....#.....#","..#.#......#...#.......#.#..","....#.......##..#...##...###",".#..##..#...................","..#...#.....###............#",".......#.#.#..#.......##.#.#","...#....#..................#",".#.#.....#.#..#.#..#...###..","##..#............#.....o....","...........##..#.........##.","..#.....#..#...#....#.....#.",".#...#...#....#........#.#..","...#...........#.#......#...","####...#.....###............",".......#.........#..#.......","...#...#.#...#.......##...##","...#.#..#...#.##.#.o..##...#",".....#..##....#...#...#.....","..#...##..#.#.....#..#.###.#","......#.#........##.....#...",".....#.........#............","...##.....#..#....#.#....#..","..#..#.......#..##...#.#...#"}
3
Returns: 34
{".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,"...................o.............................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,"........................................o........." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,"..........o......................................." ,".................................................." ,".................................................." ,".................................................." ,".....................................o............" ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".................................................." ,".......................o.........................o"}
4
Returns: 104
{"..o.." ,"...#o" ,".#..#" ,"#..#." ,".#..#" ,"#o..." ,".#.#."}
3
Returns: 14
{"............#.#..#...##..#.", "..........#..#...#.#...#..#", "...#o..#.#......###...##..#", "..#.#.#.##.#.#.##..#.#.#...", "#.#......#.#.##..#.....#...", ".............##..#..##.....", "....#....#..##............#", "...###..##.##...##....#.#..", "........#......##.#..##....", "..#.#.###.#................", "..##........#.#....#..#..##", "..#.#...##..#......#.##....", "###.###..#.#.#.......#.#.#.", "##.###..#.........#.#.#...#", "....#.....#................", "#....##..#..#.......#.#....", "...oo...#...#.#..#......##.", ".#.###......##.##.####o.#..", "..#....##.#....##.#.....##."}
4
Returns: 55
{ "....#", "o##o#", ".##oo", ".##.#", "....#" }
4
Returns: 8
{ ".....", "o....", "o....", "o....", "...o." }
3
Returns: 3
{ "........................................", "........................................", "........................................", "........................................", "...............................o........", "........................................", "........................................", "........................................", "........................................", "........................................", ".............o..........................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", ".........................o..............", ".......................................#", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", ".......................................o", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "........................................", "....o...................................", "........................................", "........................................", "........................................", "........................................" }
4
Returns: 96
{ ".##..", ".....", ".....", ".....", "o....", "o...." }
2
Returns: 5
{ "..#....", "..#.##o", "#.#.#..", "#.#o#.#", "..#.#.#", "#...#.o", "o.#.#.." }
4
Returns: 27
{ ".#...#...#...#...#...#...#...#...#...#...#o", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.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