Statistics

Problem Statement for "MovingCandies"

Problem Statement

Limak is a little bear. He is currently planning a walk on a rectangular grid. Each cell of the grid is either empty or it contains a single candy. Empty cells are denoted '.', cells with a candy are denoted '#'.


Limak wants to go from the top-left corner to the bottom-right corner of the grid. Since he loves sweets, there should be a candy in each cell he visits, including the starting and the final cell. He can only move in the four cardinal directions. In other words, he can move from cell A directly to cell B if and only if A and B share a side.


You are given the String[] t: the current state of the grid. Limak's journey may be impossible on the current grid. Your task is to make it possible by moving as few candies as you can. Moving a candy means picking it up and placing it into any empty cell.


Return the smallest number of candies that have to be moved in order to make Limak's journey possible. If there is no solution, return -1 instead.

Definition

Class:
MovingCandies
Method:
minMoved
Parameters:
String[]
Returns:
int
Method signature:
int minMoved(String[] t)
(be sure your method is public)

Constraints

  • t will have between 2 and 20 elements, inclusive.
  • Each element of t will have between 2 and 20 characters, inclusive.
  • Each element of t will have the same number of characters.
  • Each character in each element of t will be either '.' or '#'.

Examples

  1. { "#...###", "#...#.#", "##..#.#", ".#....#" }

    Returns: 3

    You must move at least 3 candies. One way of doing so is shown in the grid below. Candies were moved from cells denoted 'o' to cells denoted 'X'. #...### #XXX#.# oo..o.# .#....#

  2. { "#...###", "#...#.#", "##..###", ".#....#" }

    Returns: 2

    2 moves are enough in this example: #...### #...#.# ##XX#o# .o....#

  3. { ".#..", "##..", "..#.", "..#.", "..##", "..##" }

    Returns: 2

    Note that the starting and the final cell should both contain candies.

  4. { ".....", ".###.", "####.", "....." }

    Returns: -1

    No matter how you move candies, Limak won't be able to get from the top-left to the bottom-right corner.

  5. { ".#...#.###.#", "#.#.##......", ".#.#......#.", "..#.......#.", "##.........." }

    Returns: 9

  6. { "###.#########..#####", ".#######.###########" }

    Returns: 0

    You don't have to move any candies. Limak can already go from the top-left to the bottom-right corner.

  7. { "..", ".." }

    Returns: -1

  8. {"######.",".....##",".......",".......","######.","#..#...","#######"}

    Returns: 2

  9. {"....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","...................."}

    Returns: -1

  10. {"##..................",".#..................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","...................."}

    Returns: -1

  11. {"###.................","..########..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..",".................#..",".................###","...................#"}

    Returns: 0

  12. {".##.................","..########..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..",".................#..",".................###","...................#"}

    Returns: 2

  13. {"###.................","..########..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..",".................#..","....###...#......###",".....##............#"}

    Returns: 0

  14. {"....................","..########..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..",".................#..",".................###","...................."}

    Returns: 5

  15. {"....................","..####.###..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..","....................","...................#","...................."}

    Returns: 9

  16. {"....................","..####.###..........",".........#..........","...#.....#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..","....................","...................#",".........#.........."}

    Returns: 9

  17. {"....................","..####.###..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..","....#..#####.....#..","....#..#.........#..","....#..#...####..#..","....#..##..#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##############..#..",".................#..","....................","...................#","##########.........."}

    Returns: 8

  18. {"....................","..####.###..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..",".......#####.....#..","....#..#.........#..","....#..#...####..#..","....#..#...#..#..#..","....#...#..#..#..#..",".####...####..#..#..",".#............#..#..",".#............#..#..",".##########.###..#..",".................#..","....................","...................#","...................."}

    Returns: 9

  19. {"....................","..####.###..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#.#",".......#####.....#.#","....#..#.........#.#","....#..#...####..#.#","....#..#...#..#..#.#","....#...#..#..#..#.#",".####...####..#..#..",".#............#..#..",".#............#..#..",".##########.###..#..",".................#..","....................","...................#","...................."}

    Returns: 9

  20. {"....................","..####.###..........",".........#..........",".........#...#####..",".........#...#...#..","....######...#...#..","....#......###...#..",".......#####.....#.#","....#..#.........#.#","....#..#...####..#..","....#..#...#..#..#..","....#...#..#..#..#.#",".####...####..#..#..",".#............#..#..",".#............#..#..",".##########.###..#..",".....#...........#..","....................","...................#","...................."}

    Returns: 9

  21. {"#...................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","....................","...................#"}

    Returns: -1

  22. {"####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################"}

    Returns: 0

  23. {".###################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","####################","###################."}

    Returns: 2

  24. {"#######.###.########","######.#####.####.##","#####.#######.####..","####.#########.#####","###.#########.######","####.#######.#######","#####.#####.########","######.###......####","#######.#.##########","########.###########","###########.########","..#########.#######.","##.#######...#####.#","###.######...####.##","####.######.####.###","#####.##########.###","######.#########.###","#######.########.###","########.#######.###","#########.#####.####"}

    Returns: 1

  25. {".########.#.########","#######.############","####.#######.#######","#############.######","####.#####.####.####","##############.#####","#######.####.#######","##########.#########","###.#############.##","#######.########.##.","###.###########.##..","##############.##.##","#############.######",".........###.#######","########......######","#############......#","#############.######","#############.#.....","#############.######","#############.######"}

    Returns: 1

  26. {"....................","...................."}

    Returns: -1

  27. {"##...########...####",".#####......#####..."}

    Returns: 3

  28. {"##...########...####",".#####...#..#####..."}

    Returns: 1

  29. {"##...########...####",".#####......#####..#"}

    Returns: 0

  30. {"##...########...####",".#####..###..#####.#"}

    Returns: 1

  31. {"##...####.###...####",".#####......#####..#"}

    Returns: 3

  32. {"##...####.###...####",".#####...#..#####..#"}

    Returns: 1

  33. {"......##############","..........##########"}

    Returns: 6

  34. {"#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#"}

    Returns: -1

  35. {"#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.","#."}

    Returns: -1

  36. {"#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.",".#","#.","##"}

    Returns: 9

  37. {"############","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....####","..#.....#..#","..#######..#"}

    Returns: 0

  38. {"############","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#.....######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....####","..#.....#..#","..#######..#"}

    Returns: 2

  39. {".###########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....####","..#.....#..#","..#######..."}

    Returns: 3

  40. {".###########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##......##","...##.......","....#.......","...##.......","..##....####","..#.....#..#","..#######..."}

    Returns: 2

  41. {"############","...........#","...........#","########...#","#......#...#","#....##....#",".....#.....#","#....#.....#","#....#.....#","#.....######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....####","..#.....#..#","..#######..#"}

    Returns: 3

  42. {"...#########","...........#","...........#","#######....#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....###.","..#.....#...","..#######..."}

    Returns: 6

  43. {"...#########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....###.","..#.....#...","..#######..."}

    Returns: 6

  44. {".###.#######","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....###.","..#.....#...","..#######..."}

    Returns: 6

  45. {".###..#####.","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","....#.......","...##.......","..##....###.","..#.....#...","..#######..."}

    Returns: 6

  46. {"...#########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","..##........","...##.......","............","...##.......","..##....###.","..#.....#...","..#######..."}

    Returns: 7

  47. {"...#########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","............","............","............","............","..##....###.","..#.....#...","..#######..."}

    Returns: 10

  48. {"...#########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","............","............","............","............","..##....###.","..#.....#.#.","..#######..."}

    Returns: 9

  49. {"...#########",".##........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","............","............","............","............","..##....###.","..#.....#...","..#######..."}

    Returns: 10

  50. {"...#########","###.#......#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","............","............","............","............","..##....###.","..#.....#...","..#######..."}

    Returns: 9

  51. {"...#########","...........#","...........#","########...#","#......#...#","#....###...#","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","........####","............","............","............","..##....###.","..#.....#...","..#######..."}

    Returns: 10

  52. {"...#########",".........###",".........###","########.###","#......#.###","#....###.###","#....#.....#","#....#.....#","#....#.....#","#....#######","##..........",".##.........","........####","............","............","............","..##....###.","..#.....#...","..#######..."}

    Returns: 10

  53. {"....................","...................."}

    Returns: -1

  54. {"..",".."}

    Returns: -1

  55. {"#.",".."}

    Returns: -1

  56. {".#","#."}

    Returns: -1

  57. {".#","##"}

    Returns: 1

  58. {"##",".#"}

    Returns: 0

  59. {"##","##"}

    Returns: 0

  60. {"#.",".#"}

    Returns: -1

  61. {".#",".."}

    Returns: -1

  62. {"...","...",".#.",".#.",".#.",".#."}

    Returns: -1

  63. {".##",".#.",".#.",".#.",".#.",".#."}

    Returns: -1

  64. {".##",".#.",".#.",".#.",".#.","##."}

    Returns: 2

  65. {".##",".#.","###",".##",".#.","##."}

    Returns: 2

  66. {"#..",".#.","..#"}

    Returns: -1

  67. {"#.#",".#.","#.#"}

    Returns: 2

  68. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....##############"}

    Returns: 0

  69. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....############.."}

    Returns: 2

  70. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....###########..."}

    Returns: 3

  71. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....##########...."}

    Returns: 4

  72. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....#########....."}

    Returns: 6

  73. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....########......"}

    Returns: 7

  74. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....#####..##....."}

    Returns: 9

  75. {"#############......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....#####...#....."}

    Returns: 10

  76. {"....#########......","........#..........","........#..........","........#..........","....#####..........","....#..............","....##.............",".....####..###....."}

    Returns: 13

  77. {"#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#."}

    Returns: 10

  78. {"#.###.###.###.###.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","###.###.###.###.###."}

    Returns: 1

  79. {"#.###.###.###.###.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","###.###.###.###.####"}

    Returns: 0

  80. {"..###.###.###.###.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","#.#.#.#.#.#.#.#.#.#.","###.###.###.###.####"}

    Returns: 1

  81. {"#.###.###.###.###...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","###.###.###.###.####"}

    Returns: 0

  82. {"..###.###.###.###...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","###.###.###.###.####"}

    Returns: 2

  83. {"..###.###.###.###...","..#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","#.#.#.#.#.#.#.#.#...","###.###.###.###....#"}

    Returns: 5

  84. {"###.................", "..#....#####........", "###...##....#.......", "#.....#.....#.......", "#.....##....#####...", "##.....##.......#...", ".##.....#.......#...", "..##....#....####...", "...##...#....#......", "....#...#.....#####.", "#####...#.........##", "#.......#..........#", "#########.........##", "..............#####.", ".............##.....", "...........###......", ".###########........", ".#......#......#####", ".#......#......#...#", ".###############...#" }

    Returns: 2

  85. {".#.#.#.#.#.#.#.#####", "#.#.#.#.#.#.#.#....#", "...................#", "...................#", "...................#", "..........####.....#", "..........#..#.....#", "..........#..#.....#", "........###..#######", "........#...........", "........#...........", "........############", "...................#", "...................#", "#..#################", "#....#..............", "#...................", "#...................", "#...................", "####################" }

    Returns: 11

  86. {"###.................", "..#.................", "..#.................", "..#.................", ".##.................", ".#..................", ".#..................", "##..................", "#...................", "#...................", "#...................", "###.................", "..#.................", ".##.................", "....................", ".................#.#", "..................##", "..........#..#..#..#", "..........#.##.##..#", "...........#..##...#" }

    Returns: 21

  87. {"..", ".." }

    Returns: -1

  88. {"####################", "...................#", "####################", "#...................", "####################" }

    Returns: 0

  89. {"####...####.########", ".####..####.########", "####..#####.########", ".....######.########", "###########.########", "###########.########", "###########.########", "###########.########", "###########.########", "###########.########", "###########.########", "###########.########", "###########.########", "###########.########", "####################", "###########.########", "###########.########", "###########.########", "###########.######..", "###########.######.#" }

    Returns: 2

  90. {"###########.........", "###########........." }

    Returns: 9

  91. {"####################", "...................#", "##################.#", "#................#.#", "#.##############.#.#", "#.#............#.#.#", "#.#........###.#.#.#", "#.#........#.#.#.#.#", "#.##########.#.#.###", "#............#.#....", "##############.#####" }

    Returns: 0

  92. {".................#..", ".#.....#...#......#.", ".##.........#.....#.", "........#.....#.....", "...#................", "....#.....#.......#.", "...............#....", "...#................", "............#...#...", "#...#.#.........#...", ".............#......", "#....#.#............", ".............#......", "......#..........#..", ".#......##..#.......", "...........#.#..#...", "..#....#............", ".....#........#.....", ".........#......#...", ".......#.......#.##." }

    Returns: 23

  93. {"#.##################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################", "####################" }

    Returns: 0

  94. {"#.#####", "#.#...#", "#.#....", "###...." }

    Returns: 3

  95. {"...###..#...........", "#.............#.#...", "#.##..#....#.....#..", "#.#............#....", "...#.............#.#", "#....#..............", "..#..##.#...........", "......#............#", ".#..#.#...........#.", "..##..##.#.#.#....#.", "..#........#.#......", ".#..##..#.....#.....", ".#.......##.........", "................#...", "......##..##........", "...........#.......#", "##......#...........", ".#....#........##..#", "...#................", ".....#.............." }

    Returns: 18

  96. {"####################", "...................#", "####################", "#...................", "####################", "...................#", "####################", "#...................", "####################", "...................#", "####################", "#...................", "####################", "...................#", "####################", "#...................", "####################", "...................#", "####################" }

    Returns: 0

  97. {"#...###", "#...#.#", "##..#.#", ".#...##" }

    Returns: 2

  98. {"#.....########", "#.....#......#", "#............#", "#.....#......#", "#.....#......#", "#######......#" }

    Returns: 5

  99. {"#....", "#.#.#", "###.#", "....#" }

    Returns: 1

  100. {"####################", "...................#", "####################", "#...................", "####################", "...................#", "####################", "#...................", "####################", "...................#" }

    Returns: 0


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: