Please also specify the map is a full free usable rectangle, there could be objects in the middle of the playground making the snails slow down or forcing them to avoid the cell/obstacle in further episodes
Are you rounding anywhere in your solution?
A rather straightforward puzzle - after reading this discussion and making some assumptions that I would not have to worry about:
- any obstacles (there are none - and, to be fair, the statement does not say there would be any, though the phrasing
where a snail can gomade me assume there were also places where it could not go); - snails occupying the same space (it is possible);
- snails knowing their destination or simply picking
a path closest to it(it is the former: snails know where to go to, so they pick the smallest path to any destination rather than any available path closest to the snail).
This puzzle should definitely have a Distances tag.
Nice one puzzle. So easy. I missed high density cases where I’m sure my code without any optimization would have failed due to a timeout. Still, I didn’t predict cases like the input line without a snail, or the snails moving vertically (although it says it clearly in the description), which made me have a bit more fun with the exercise.