/parking-lot

A node script that finds the nearest 0 in a 2D array.

Primary LanguageJavaScript

  1. Clone this repository
  2. To run tests from CLI: npm run test
  3. To run with custom input from CLI: node index.js "[[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 0]]"
  4. To run the solution in your own test suite: const solution = require("./index");

The biggest issue my solution has it tall parking lots. With more time, I'd optimize this, or consider a different approach if that proved too convoluted.