Skip to content

migueladelgado/challenges-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

challenges-javascript

A repo to contain javascript challenges

Power the Neighborhood

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]
]

About

A repo to contain javascript challenges

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published