Skip to content

Instantly share code, notes, and snippets.

@rkumorek
rkumorek / 1-setup.js
Created September 19, 2022 21:39 — forked from getify/1-setup.js
find size of largest region in matrix... solutions are breadth-first iterative (2) and depth-first recursive (3)
// Adapted from: https://www.geeksforgeeks.org/find-length-largest-region-boolean-matrix/
"use strict";
var M1 = [
[ 0, 0, 1, 1, 0 ],
[ 1, 0, 1, 1, 0 ],
[ 0, 1, 0, 0, 0 ],
[ 0, 0, 0, 1, 1 ]
];