kimmellj / blob-boundary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blob Boundary Finder

The challenge:

A Blob is a shape in two-dimensional integer coordinate space where all cells have at least one adjoining cell to the right, left, top, or bottom that is also occupied. Given a 10x10 array of boolean values that represents a Blob uniformly selected at random from the set of all possible Blobs that could occupy that array, write a program that will determine the Blob boundaries. Optimize for finding the correct result, performing a minimum number of cell Boolean value reads, and elegance and clarity of the solution.

Sample Input

The raw input:

0000000000
0011100000
0011111000
0010001000
0011111000
0000101000
0000101000
0000111000
0000000000
0000000000

Running

  • $ git clone https://github.com/tgrowden/blob-boundary.git
  • $ cd blob-boundary
  • $ yarn
  • $ yarn start

About


Languages

Language:TypeScript 100.0%