Statistics

Problem Statement for "Unblur"

Problem Statement

A simple way to blur an image is to replace each pixel with the average of it and its neighboring pixels. The value of each pixel in the blurred image is computed by adding the values of the 3x3 region centered at the corresponding pixel of the original image, and dividing by 9.

When computing the value of pixels on the border, the 3x3 region will fall partially outside of the original image. Assume that pixels outside of the original image are black.

For example, given the following original image:

the algorithm described above results in the following blurred image:

Write a method that will, given a blurred image, return the original image. The original image will contain only black and white pixels. All pixels on the top and bottom rows and left and right columns of the original image will be black. All values of the blurred image will therefore be: 0 (black), 1/9, 2/9, 3/9, 4/9, 5/9, 6/9, 7/9, 8/9, or 9/9 (white).

The blurred image will be given as a String[]. Each character in the blurred image will be a character between '0' and '9', inclusive, giving the value of that pixel multiplied by nine. For example, the blurred image above would be given as:

{ "1233321000000000123332100000000000000000000",
  "1244422233222332334343323322232112332223321",
  "1255523344343443545343434434343233432334432",
  "0033303455465775633011445546454355753457753",
  "0033303333364543533011433336333364521346542",
  "0033303455464532445343545546454355753446542",
  "0022202344342200234343434434343233432323221",
  "0011101233221100123332223322232112332211111" }

Return the original image as a String[]. For each pixel in the original image, return a '.' if it is black and '#' if it is white. For example, the original image for the example above would be returned as:

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

Definition

Class:
Unblur
Method:
original
Parameters:
String[]
Returns:
String[]
Method signature:
String[] original(String[] blurred)
(be sure your method is public)

Constraints

  • blurred will contain between 1 and 50 elements, inclusive.
  • Each element of blurred will have a length between 1 and 50, inclusive, and contain only characters between '0' and '9', inclusive.
  • Each element of blurred will have the same length.
  • blurred will be the result of blurring a black and white image.

Examples

  1. { "1221", "1221", "1221" }

    Returns: { "....", ".##.", "...." }

    All pixels in the center two columns are adjacent to two white pixels in the source image. The remaining pixels are adjacent to only one.

  2. { "00000", "00000", "00000", "00000" }

    Returns: { ".....", ".....", ".....", "....." }

    A solid black image blurs to all zeros.

  3. { "0011212121100", "0123333333210", "0123333333210", "1233333333321", "1233333333321", "1233333333321", "0112121212110" }

    Returns: { ".............", "...#.#.#.#...", "..#.#.#.#.#..", ".............", ".#.#.#.#.#.#.", "..#.#.#.#.#..", "............." }

    original: blurred:

  4. { "12333333333321", "24666666666642", "36999999999963", "36999999999963", "24666666666642", "12333333333321" }

    Returns: { "..............", ".############.", ".############.", ".############.", ".############.", ".............." }

  5. { "1233321000000000123332100000000000000000000", "1244422233222332334343323322232112332223321", "1255523344343443545343434434343233432334432", "0033303455465775633011445546454355753457753", "0033303333364543533011433336333364521346542", "0033303455464532445343545546454355753446542", "0022202344342200234343434434343233432323221", "0011101233221100123332223322232112332211111" }

    Returns: { "...........................................", ".#####...........#####.....................", "...#...####.####.#...#.####.###..####.####.", "...#...#..#.#..#.#.....#..#.#..#.#....#..#.", "...#...#..#.####.#.....#..#.#..#.###..####.", "...#...#..#.#....#...#.#..#.#..#.#....#.#..", "...#...####.#....#####.####.###..####.#..#.", "..........................................." }

    This is the example from the problem statement.

  6. { "0000123210000", "0012456542100", "0135789875310", "0258988898520", "1479865689741", "2589742479852", "2589742479852", "1479865689741", "0258988898520", "0135789875310", "0012456542100", "0000123210000" }

    Returns: { ".............", ".....###.....", "...#######...", "..#########..", "..####.####..", ".####...####.", ".####...####.", "..####.####..", "..#########..", "...#######...", ".....###.....", "............." }

    original: blurred:

  7. { "11100000000000000000000000000000000000000000000000", "11100000000000000000000000000000000000000000000000", "11100000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000" }

    Returns: { "..................................................", ".#................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", ".................................................." }

  8. { "00000000000000000000000000000000000000000000000111", "00000000000000000000000000000000000000000000000111", "00000000000000000000000000000000000000000000000111", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000" }

    Returns: { "..................................................", "................................................#.", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", ".................................................." }

  9. { "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000111", "00000000000000000000000000000000000000000000000111", "00000000000000000000000000000000000000000000000111" }

    Returns: { "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "................................................#.", ".................................................." }

  10. { "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000", "11100000000000000000000000000000000000000000000000", "11100000000000000000000000000000000000000000000000", "11100000000000000000000000000000000000000000000000" }

    Returns: { "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", ".#................................................", ".................................................." }

  11. { "12333333333333333333333333333333333333333333333321", "24666666666666666666666666666666666666666666666642", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "24666666666666666666666666666666666666666666666642", "12333333333333333333333333333333333333333333333321" }

    Returns: { "..................................................", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".................................................." }

  12. { "01233333333333333333333333333333333333333333333321", "13566666666666666666666666666666666666666666666642", "25899999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "24666666666666666666666666666666666666666666666642", "12333333333333333333333333333333333333333333333321" }

    Returns: { "..................................................", "..###############################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".................................................." }

  13. { "12333333333333333333333333333333333333333333333321", "24666666666666666666666666666666666666666666666642", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999999999999999999852", "24666666666666666666666666666666666666666666666531", "12333333333333333333333333333333333333333333333210" }

    Returns: { "..................................................", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".################################################.", ".###############################################..", ".................................................." }

  14. { "11112333333333333333333222322222122333333333333321", "23433456666666666666666555655555455666666666666642", "35766667899999999999999888988888788999999999999852", "36987666678999999999999999999999999999999999999741", "36999876678999999999999999999999999999999999998631", "36999998778999999999999999988788999999999999997632", "36999999999999999999999999988788999999999999986643", "36999999999999999999999999977577999999999999976653", "36999999999999999999999999988788999999999999866763", "36999999999999999999999999988788999999999999766863", "36999999999999999999999999999999999999999999777963", "36999988899999999999999999999999999999999999888963", "36999988899999999998889999999999999999999988899963", "36999988899999999986568999999999999999999865689963", "36999999999999999986568999999999999999999854589963", "36999999999999999987678999999999999999999865689963", "25899999999999999999999999999999999999999988899852", "25899998889999999887878899999987789999999999999852", "14799998889999999887878899999986679999999999999852", "25899998889999999876667899999986679999999999999963", "25899999999999999988788999999998889999999999999852", "25899999999999999988788999999999999999999999999852", "25899999999999999999999999999999999999999999999852", "25899999998778999999999999999999999999999999999852", "36999999997557999999999999999999999999999999999852", "25899999997557999999988899999999999888999999999741", "25899999998778999999977799999999998767899999999852", "25899999999999999999977799999999998656899999999852", "36999999999999999999988899999999998767899999999963", "36999999999999999999999999999999999888999999999963", "36999999999999999999999999999999999999999999999963", "36999999999987789999999999999999999999999999999963", "36999999999987789999999999999999999999988899999963", "36999999999987789999999999999999999999977688999963", "36999999999999999999999999999876789999977577999963", "36999999999999999999999999999765789999988677999963", "36999999999999999999999999999765789999999888999963", "36999999999999999999999999999888999999999999999963", "36999999999999999999999999999999999999999999999963", "36999999999999999999999999999999877899999999999963", "36999999999999999999999999999999765789999999999963", "36999999999999999988899999999999753579999988899963", "36998889999999999876789999999999875679999987789963", "36987789999999999876789999999999987789999987678963", "36876789999999999887889999999999999999999998767863", "35767899999999999999999999999999999999999999876753", "24678999999999999999999988898888878899999999987753", "12456666666666666666666655565555545566666666665532", "01233333333333333333333322232222212233333333333321" }

    Returns: { "..................................................", ".#..####################.###.##.#.###############.", ".###..###########################################.", ".#####..########################################..", ".#######..######################################..", ".##############################################.#.", ".###########################.#.################.#.", ".#############################################.##.", ".###########################.#.###############.##.", ".############################################.###.", ".############################################.###.", ".################################################.", ".######.#########################################.", ".###################.######################.#####.", ".##################...####################...####.", ".##########################################.#####.", ".################################################.", "..##############################################..", ".#######.#########.#.#.########..################.", "..##############################.################.", ".##################.#.###########################.", ".###############################################..", "..###############################################.", ".################################################.", ".##########..###################################..", ".##########..####################################.", "..####################.#############.###########..", ".#####################.############.#.###########.", ".###################################.############.", ".################################################.", ".################################################.", ".################################################.", ".############..##################################.", ".#######################################.########.", ".#######################################.#.######.", ".#############################...#########.######.", ".#############################.##################.", ".################################################.", ".################################################.", ".################################################.", ".################################..##############.", ".################################.#.#############.", ".##################.##############..#######.#####.", ".####.############.#.#######################.####.", ".###.########################################.###.", ".##.##########################################.##.", ".#.############################################.#.", "..#######################.###.##.#.##############.", ".................................................." }

  15. { "0000000000000000000000000000000000000000000000000", "0123333333333333333333333333333333333333333333321", "0123333333333333333333333333333333333333333333321", "1356666666666666666666666666666666666666666666531", "1233333333333333333333333333333333333333333333210", "1356666666666666666666666666666666666666666666531", "0123333333333333333333333333333333333333333333321", "1356666666666666666666666666666666666666666666531", "1233333333333333333333333333333333333333333333210", "1233333333333333333333333333333333333333333333210", "0123333333333333333333333333333333333333333333321", "0123333333333333333333333333333333333333333333321", "0123333333333333333333333333333333333333333333321", "1233333333333333333333333333333333333333333333210", "1233333333333333333333333333333333333333333333210", "1233333333333333333333333333333333333333333333210", "0000000000000000000000000000000000000000000000000" }

    Returns: { ".................................................", ".................................................", "..##############################################.", ".................................................", ".##############################################..", ".................................................", "..##############################################.", ".................................................", ".##############################################..", ".................................................", ".................................................", "..##############################################.", ".................................................", ".................................................", ".##############################################..", ".................................................", "................................................." }

  16. { "000", "000", "000" }

    Returns: { "...", "...", "..." }

  17. { "111", "111", "111" }

    Returns: { "...", ".#.", "..." }

  18. { "11211", "11211", "22422", "11211", "11211" }

    Returns: { ".....", ".#.#.", ".....", ".#.#.", "....." }

  19. { "01110111011111111111212122222321000000000000112221", "01110111011111111111212122222321000000000000112221", "01110111011111111111212122222321000000000000112221" }

    Returns: { "..................................................", "..#...#...#..#..#..#.#.#.##.###..............#.##.", ".................................................." }


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: