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.