Same thing here, even after removing anything fancy, just using a couple for loops. All tests pass, but validators 5 and 6 fail. No idea why.
Don’t forget that the light goes in every direction :
X X X X X X X X X X X X C X X X X X X X X X X X X
with a light of 4 will become
2 2 2 2 2 2 3 3 3 2 2 3 4 3 2 2 3 3 3 2 2 2 2 2 2
Just a little suggestion: think before code. It wasn’t asked how strong the light on each cell is. You only need to know which cells have any light (or more accurately: how many cells are totally dark). If you consider this, it’ll be a pretty easy puzzle, no real need for recursion, BFS or anything special
Thanks for that neat little puzzle that showed once again that the simplest solution is in most cases also the best.
Thanks for that puzzle. A friend gave me a new idea to determinate light level and it solved 5 and 6 problems. (Java)
Finally i found it !
my problem was not about comprehension of the problem, but about how i evaluate the distance between candles and cells. I try the classic sqrt((x1-x2)²+(y1-y2)²) and this solution works surprisingly well on all the test cases except validation 5 and 6… I hope it will help !
Have to say I enjoyed this puzzle.
I didn’t use recursion as much as a few nested loops after identifying light sources, intensities, and cellar bounds.
I agree that this feels like the top end of the easy level in so far as my prior experiences go with these puzzles.
While I realized that light intensities don’t necessarily have to play a part here, I think it was interesting to consider when putting up the solution.
LOL nice that i find one like me
It has to play a role! it should differ if l=2 or =3 it makes a different what u mean by
don’t necessarily have to play a part here
Sorry for the confusion. I agree that it plays a part, but I meant that the end result is determining how many areas have 0 light, so theoretically if you create a process just indicating where light exists vs where it doesn’t I think you can still put out a similar solution.
Hey, I’m having the same problem with the validator not accepting challenges 5 and 6 (In the IDE all challenges are fully completed).
Can I show one of you guys my Python code? Thx <3
Could you please explain the same in detail. Thanks!!
maybe i get it when i find the solution thx
Nice easy puzzle. As written in a previous message - keeping it simple here is the best approach, and indeed no need to consider light intensity (although it was nice as part of the D&D description…)
Thinking about the original premise a bit more - I can see here the potential for a bit harder puzzle, that will ask you to find a path between two points in the room where you get the least accumulated light