A repo to contain javascript challenges
This challenge requires to write an algorithm to calculate the number of days it would take to turn on power for each house in a neighborhood where a 2D array is given and each item in the inner arrays is considered a house.
in the example below we have to rows (streets) with 4 homes in each. The 0 values represent no power, and 1 with power. Only a home with power can turn on power for an adjacent home and they can only do this once a day. How many days would it take? For the example below it would be 3 days.
[
[0,1,0,0],
[0,0,0,1]
]