=======================
Bridgewater coding challenge #2
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 first for finding the correct result, second for performing a minimum number of cell Boolean value reads, and third for the elegance and clarity of the solution.
$ git clone https://github.com/gabe0912/Blob.git
$ cd Blob
$ java -jar out/artifacts/blob_jar/blob.jar inputBlob.txt
https://github.com/gabe0912/Blob/tree/master/src/main/java
Main-Class: BlobBoundary.java
- Blobs are a significant percentage of the entire matrix, so walking the edge should be efficient enough
- We start "walking" clockwise from the origin
- Could be more optimal by assuming blobs are always connected - this would lower the number of cells read
- Could potentially also save reads by iterating counter-clockwise once initial position is found since we already know elements on the left, top, and top-left positions must be clear