DEV Community

Discussion on: Daily Challenge #149 - Fun with Lamps

 
rafaacioly profile image
Rafael Acioly • Edited

I don't know, i think that you understood it right your solution makes sense, the way that i imagine there is no way to get the "less changes needed" because i'll switch everything to see if it it's alternated

Thread Thread
 
kmruiz profile image
Kevin Mas Ruiz

I though the solution was to count the number of changes to light everything on or off. But the idea is to find out the number of changes for alternate lights, so the solution there is wrong :(.

I just changed the original post to add the new solution.

Thread Thread
 
aminnairi profile image
Amin

Now that I read the comments, I think Kevin is right, but I understood it from the point of view of Rafael. But it makes sense since they need to alternate, not to start with 0 (switched off) everytime.