Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Harry.B,validated by @DeanTheMachine,@Maxim1n and @Delicious31415.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Harry.B,validated by @DeanTheMachine,@Maxim1n and @Delicious31415.
If you have any issues, feel free to ping them.
Using Test case 03 as example, would anyone convince me why the following plan of throwing dice, making use of all six ladders, is incorrect?
All looks good apart from the ending.
Consider checking the snakes ![]()
Test 3 uses a 6 sided dice so from 382 to 400 does indeed require 3 rolls (382 → 388 → 394 → 400)
However, there is a snake head on 394 meaning it can’t be used and you need to throw an extra dice to avoid that tile.
Hope this helps.
Is the DFS tag applicable for cyclic graphs like this puzzle implies? Interestingly DFS with DP passes all test cases and validators except one validator which I think proves the point. Has anyone solved this with DFS?
Just to be more clear since the above is a rhetorical question and I had problems in the past communicating in such way. So I’ll simplify: I believe the tag should be removed since finding the shortest path with DFS does not work with cyclic graphs even though the majority of the test cases data are conveniently “working”. If someone else believes otherwise please reply cordially.
I converted my BFS solution to a DFS and pass all the validators in Python. (DFS solution)
As long as you’re pruning the paths correctly, I don’t see why the DFS wouldn’t find the optimal solution. DFS is not the optimal way to find the solution of course but works fine as I understand it… If you provide an example where it wouldn’t work, I’ll be happy to remove the tag.
I see now, thanks!